zero-perfoliate
zero-perfoliate

Author Topic: HOW to sort files  (Read 155 times)

Offline ejuniour

  • New PHP Members
  • Posts: 2
  • Karma: +0/-0
HOW to sort files
« on: July 22, 2010, 09:17:59 AM »
Code: [Select]
<?PHP

$folder = "123/";
$handle = opendir($folder);

# Making an array containing the files in the current directory:
while ($file = readdir($handle))
{
    $files[] = $file;
}
closedir($handle);

#echo the files
foreach ($files as $file) {
    echo "<a href=$folder$file>$file</a>"."<br />";
}
?>

THIs is script i want to made modification in it, i want that script to sort files w.r.t modification time and aslo give the L mod time next to file name.

please help me