note 35638 deleted from ref.filesystem by pollita
| From: | pollita@php.net | Date: | Sat, 22 Nov 2003 02:01:10 +0000 |
| Subject: | note 35638 deleted from ref.filesystem by pollita | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-60795@lists.php.net to get a copy of this message | ||
Note Submitter: curlee@mindspring.com
----
Here is quick way to read a dir listing into an array (this is helpfull when you want to walk
through a dir file-by-file)
Here is the code:
// Load up array with file names!
$handle = opendir(/path/to/your/dir);
$array_indx = 0;
while (false !== ($file = readdir($handle)))
{
$dir_array[$array_indx] = $file;
$array_indx ++;
}
foreach ($dir_array as $n)
{
// put your per-file code here
// example: print "<br>Filename: ".$n."<br>";
}