$archiveNumber = 0;
$archiveDirectory = 'blogtext/';
$archiveHandle = opendir( $archiveDirectory );
$entryAfter;
$entry;
if( $archiveHandle = opendir( 'blogtext/' ) )
{
while( false !== ( $entry = readdir( $archiveHandle ) ) )
{
if( $entry != '.' && $entry != '..' && !is_dir( $entry ) && strpos( $entry, '-subject' ) )
{
$entryAfter = str_replace( '-'.$number.'-', '', $entry );
$entryAfter = str_replace( '-subject', '', $entryAfter );
$entryAfter = str_replace( '.txt', '', $entryAfter );
echo '<a href="blog/'.strtolower( $entryAfter ).'.php"> ';
include( 'blogtext/'.$entry );
echo '</a><br>';
$number++;
}
}
closedir( $archiveHandle );
}
Is there any way to reverse the order in which the links are echoed out in this function?
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.
( I know that the way that I’m doing this is probably pants-on-head-retarded. You don’t need to mention that. )
Note that I didn’t test this, but the idea hould work.