Sort Array Of Files By Last Modified
<p>Using the below action I gather a list of files and display them. I need to be able to sort the files by last modified date. Is there a simple way in PHP or using ZEND to order the items by last modified? If you know of a easier way to get the files and order them using ZEND; please let me know.</p>

<pre><code>public function imagesAction()
{
    $this-&gt;_helper-&gt;layout-&gt;disableLayout();

    $results = array();

    $handler = opendir(APPLICATION_PATH . '/../public/images/blog');

    while ($file = readdir($handler)) {
        if ($file != "." &amp;&amp; $file != ".." &amp;&amp; $file != '.svn') {
            $results[] = $file;
        }
    }

    closedir($handler);

    $this-&gt;view-&gt;data = $results;
}
</code></pre>

<p>I have tried doing</p>

<pre><code>$this-&gt;view-&gt;data = ksort($results);
$this-&gt;view-&gt;data = asort($results);
</code></pre>

<p>But those just remove the entire list of files from the view and they stop showing up.</p>
