PHP: Reversing the order in which links are echoed out ( apparently very difficult )
<pre><code>$archiveNumber = 0;
$archiveDirectory = 'blogtext/';
$archiveHandle = opendir( $archiveDirectory );
$entryAfter;
$entry;
if( $archiveHandle = opendir( 'blogtext/' ) )
{
    while( false !== ( $entry = readdir( $archiveHandle ) ) )
    {
        if( $entry != '.' &amp;&amp; $entry != '..' &amp;&amp; !is_dir( $entry ) &amp;&amp; strpos( $entry, '-subject' ) ) 
        {
            $entryAfter = str_replace( '-'.$number.'-', '', $entry );
            $entryAfter = str_replace( '-subject', '', $entryAfter );
            $entryAfter = str_replace( '.txt', '', $entryAfter );
            echo '&lt;a href="blog/'.strtolower( $entryAfter ).'.php"&gt; ';
            include( 'blogtext/'.$entry );
            echo '&lt;/a&gt;&lt;br&gt;';
            $number++;
        }
    }
    closedir( $archiveHandle );
}
</code></pre>

<p>Is there any way to reverse the order in which the links are echoed out in this function?</p>

<p>At the moment, the links are printed out in reverse order ( starting with -biggestnumber-name.php, and ending with -smallestnumber-name.php ). And I'd like to reverse it.</p>

<p>( I know that the way that I'm doing this is probably pants-on-head-retarded. You don't need to mention that. )</p>
