I have several files which contain some PHP
includes and I want to substitute them with the file contents. The file looks like
foo <?php include("file1.php"); ?> bar baz <?php include("file2.php"); include("file3.php"); ?> more content
foo should be the content of file1.php and after
baz should be first content of file2.php followed by file3.php.
I want also remove the
?> tags in both cases. What is a good way to resolve this?
Assume the following file contents:
file1.php: is empty
So the resulting file should look like:
foo bar baz <p>Hello World</p> more content
bar etc. are just expletives within the real file there could be any text.