note 64133 deleted from function.scandir by felipe
| From: | felipe@php.net | Date: | Fri, 29 Aug 2008 23:24:33 +0000 |
| Subject: | note 64133 deleted from function.scandir by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-143998@lists.php.net to get a copy of this message | ||
Note Submitter: elbekko at gmail dot com
----
Scandir function for php 3 and up.
<?php
//
// Scandir for PHP4
//
if(!function_exists('scandir'))
{
function scandir($dir, $sortorder = 0)
{
if(is_dir($dir))
{
$dirlist = opendir($dir);
while( ($file = readdir($dirlist)) !== false)
{
if(!is_dir($file))
{
$files[] = $file;
}
}
($sortorder == 0) ? asort($files) : arsort($files);
return $files;
}
else
{
return FALSE;
break;
}
}
}
?>