Get files form dir with glob and check if it is in array then include?
<p>How could I use the php function <code>glob</code> to get files from a directory and put them in an array and then include them with <code>index.php?file=filename</code> if it exists?</p>

<p>This is what I came up with so far but it doesn't work.</p>

<pre><code>$files = glob("files/*.php");
$file = array($files);

if (in_array(..
</code></pre>

<p>OR is there a smarter way to do this without having to write all pages in the <code>index.php</code>?</p>
