note 1386 deleted from function.readdir by philip
| From: | philip@php.net | Date: | Fri, 08 Nov 2002 01:50:27 +0000 |
| Subject: | note 1386 deleted from function.readdir by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-39109@lists.php.net to get a copy of this message | ||
Here's a quick code snippet that will load the directory data into an array.
function GetDirArray($sPath)
{
//Load Directory Into Array
$handle=opendir($sPath);
while ($file = readdir($handle))
$retVal[count($retVal)] = $file;
//Clean up and sort
closedir($handle);
sort($retVal);
return $retVal;
}