How to get all the included php code as string?
<p>There's a script with a bunch of <code>include</code>/<code>require</code>s of, say, 20 files and I'd like to get the contents off them all as 1 string.</p>

<p>One way to do this would be to <code>get_included_files</code> and then read all of them adding to a string, but the problem is that those files might not end with <code>?&gt;</code>, so the resulting string would not be valid php code, e.g. </p>

<pre><code>&lt;?php // file 1&lt;?php // file 2 
</code></pre>

<p>instead of </p>

<pre><code>&lt;?php // file 1 // file 2
</code></pre>
