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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
The-Last-Escape Posted May 1, 2007 Author Share Posted May 1, 2007 Thanks for the advice Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.