The-Last-Escape Posted May 1, 2007 Share Posted May 1, 2007 To be honest, I can't remember if I dreamt this (dreaming about programming, such a life I have) or if it is real, but is there a function one can call to get the php code from a php file displayed in a browser...I know that you can't just save a php file and look at the code, it is all handled on the server end, but I either dreamt or read that there is a function that you can use to read the backend code for any file...and if this is so, is it only possible on localhost or can you check any url in cyberspace for it? I apologize if i make no sense. Link to comment https://forums.phpfreaks.com/topic/49556-solved-random-php-function-question/ Share on other sites More sharing options...
ToonMariner Posted May 1, 2007 Share Posted May 1, 2007 you can read the contents of a file into a string or array (using fread) and then use htmlentities to convert all the tags that would be picked up by a browser to echo them out. Link to comment https://forums.phpfreaks.com/topic/49556-solved-random-php-function-question/#findComment-242912 Share on other sites More sharing options...
The-Last-Escape Posted May 1, 2007 Author Share Posted May 1, 2007 Thanks for the advice Link to comment https://forums.phpfreaks.com/topic/49556-solved-random-php-function-question/#findComment-242913 Share on other sites More sharing options...
trq Posted May 1, 2007 Share Posted May 1, 2007 Also, you can configure your server (well, Apache anyway) to parse php as syntax highlighted html. This is usually done by using the .phps (pseudo) file extension. I wouldn't recommend it on a production server though. Link to comment https://forums.phpfreaks.com/topic/49556-solved-random-php-function-question/#findComment-242916 Share on other sites More sharing options...
The-Last-Escape Posted May 1, 2007 Author Share Posted May 1, 2007 Ok thank you Thrope for the extar advice Link to comment https://forums.phpfreaks.com/topic/49556-solved-random-php-function-question/#findComment-242918 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.