Hello is there a way to take the content of a php file while processing the php code in it?
I need to include a code into another page but I need to print the content it in a specific position.
If I use include the code will be printed before the html tag of course cause it’s processed before the page, but if I use file_get_contents the content is taken in the page but if I have some php tags I’ll get those too as plain text.
Thank you.
EDIT: sorry guys seems like I was drunk while I was writing. I corrected.
I have an engine that processes the page contents, puts them into a variable and then print them in a specific position within the html page. In the engine I need to “embed” the code of other “static” pages that could have some php tags. If I use file_get_contents I will get the content as plain text (with php tags not parsed) if I use include it just won’t work cause it’s not the function for it. So I what I need is to embed the PROCESSED code into the engine (as ready-to-be-printed HTML).
You can use an output buffer to include a PHP file but save the resulting output for later use instead of printing it immediately to the browser.