I need my script to sort the .txt files by date. it's like a simple news script, what i do is adding .txt files named:
[23.7.13] New cool title [24.7.13] advices and tips
and echo the contents, already have everything ready including the echo part but it wont sort them by the first dates.. how can i do this?
<?
if( $handle = opendir( 'includes/news' ))
{
while( $file = readdir( $handle ))
{
if( strstr( $file, "txt" ) )
{
$addr = strtr($file, array('.txt' => ''));
echo '<h1><a href="?module=news&read=' . $addr . '">»' .
$addr . "</a></h1>";
}
}
closedir($handle);
}
}
?>