PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I know its possible to display the contents of say a .html file or even a .php file using PHP code. But, heres the kicker, is it possible to display the code after it has been processed by the PHP engine? And I am not asking about the output I am talking about the actual code.
So:
Request for file is made -> file is processed by PHP Engine -> the processed code is displayed but NOT the output, simply what the php encoder reads
I know this is a random question but if its possible let me know how, just wondering if its possible to send a file through the interpriter and then read the file contents once they have passed through.
if you are running it through the php interpreter, then I'd say no. Although, there are some useful functions you can use, such as highlight_file(), highlight_string(), or change the php extension to phps
The only example I can think of is: a file is encoded as Zend, thus once the file passes through the Zend engine the code is processed into PHP readable code thus the output for the code would be the decoded code.
I know that sounds bad but I cant think of another way to explain it.
last I checked, once php has done it's first pass, it is converted into opcodes. Is that what you're wanting to see? Or the code just prior to being converted?
A sure fire way to do that is to add some code to the php engine which writes the parsed php code to a file after it parses it & before it processes it. You would most likely have to recompile it.