note 34066 deleted from function.readdir by tularis
| From: | tularis@php.net | Date: | Sun, 13 May 2007 19:06:44 +0000 |
| Subject: | note 34066 deleted from function.readdir by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-126552@lists.php.net to get a copy of this message | ||
Note Submitter: web at fischenich dot org
----
Why not sorting by filemtime like this?
$handle=opendir($fPath);
while ($file = readdir($handle))
{
if($file=='.'||$file=='..')
continue;
if (preg_match("/\.(esp|xml)$/", $file)){
$filetlist [$file] = filemtime ($fPath.'/'.$file);
}
}
asort($filetlist);
while (list ($key, $val) = each ($filetlist))
{
echo $key;
}