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
So after 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 <?php and ?> tags in both cases. What is a good way to resolve this?
Assume the following file contents:
file1.php: is emptyfile2.php:<p>Hellofile3.php:World</p>
So the resulting file should look like:
foo
bar
baz
<p>Hello
World</p>
more content
The word foo, bar etc. are just expletives within the real file there could be any text.


