note 38389 added to function.readdir
| From: | DawnitaRoberts at rn2 dot php dot net | Date: | Fri, 19 Dec 2003 04:34:08 +0000 |
| Subject: | note 38389 added to function.readdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-62203@lists.php.net to get a copy of this message | ||
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
:)
----
Manual Page -- http://www.php.net/manual/en/function.readdir.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38389
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38389&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38389&report=yes
Search -- http://master.php.net/manage/user-notes.php