Reputation: 1869
how to load a php file to just display the contents of the file, not executing it?
I want to see the contents on a web browser. But I can't find a way to load without it executing the contents.
thanks
Upvotes: 2
Views: 102
Reputation: 3432
If its just one large block, you could remove the tags..
otherwise, just rename the file to whatever.php.txt and load it in a browser..
Upvotes: 0
Reputation: 10107
If you're programming in php in order to view a PHP file, simply load the file into a string, then run it through htmlentities before displaying it. It will escape all the html special characters and cause it to be displayed literally.
Upvotes: 1