I have 2 files.
test.zt
with the content of a lot of PHP and HTML come.
index.php
where I'm including test.zt
to display it's contents.
What I want to do now is to load test.zt
contents into a variable (or something to be able to temporarily edit it). When it's done I want to use str_replace()
function to change some text in the test.zt
file temporarily. I do not want to overwrite the original test.zt
source file.
After that I would like to display the changed file's content to the visitor.
Note: the code is containing PHP code and the page needs to execute that PHP code as well.
I have already tried to open the file with file_get_contents()
and then echo out the contents, but it did not execute the PHP side of the content.
Is there any possibility to make this happen?