Filter files in DirectoryIterator output
<p>I'm working on a script that gets file modified times, and takes an optional arg that if filled has an array with a list of files to check rather then every file. How could I go about just getting the data for those files in a script like this:</p>

<pre><code>$filesObject = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));

foreach ($filesObject as $key =&gt; $object)
{
    $checkFile = filemtime($object-&gt;getPathname());
    $num++;
    $alertFiles[$num] = array('name' =&gt; $object-&gt;getPathname(),
                              'time' =&gt; $checkFile);
}
</code></pre>

<p>edit: this code is in a function where $filesArray is the array of file names that can be passed.</p>
