note 38389 deleted from function.readdir by nlopess
| From: | nlopess@php.net | Date: | Fri, 19 Dec 2003 09:04:54 +0000 |
| Subject: | note 38389 deleted from function.readdir by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62211@lists.php.net to get a copy of this message | ||
Note Submitter: Dawnita Roberts
----
Loading the contents of one Directory (in this case, a bunch of mp3s) into an array...
------
$index = 0;
if ( $mp3dir = opendir("mp3/") )
while ( false !== ( $mp3s[$index++] = readdir($mp3dir)) )
------
$mp3s now contains an array of filenames. This is kinda cheap because you still have to ignore
"." and ".." when parsing the array, but it's quick and kinda slick lookin
:)