RE: [PHP] Listing files from a directory
| From: | Seb Frost | Date: | Tue, 21 Aug 2001 15:43:47 +0000 |
| Subject: | RE: [PHP] Listing files from a directory | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63723@lists.php.net to get a copy of this message | ||
store all the names in an array and then sort that using an inbuilt php
function, maybe.
- seb
-----Original Message-----
From: Martin E. Koss [mailto:mek@mek.co.uk]
Sent: 21 August 2001 16:43
To: php-general@lists.php.net
Subject: [PHP] Listing files from a directory
I am trying to find a way to list files alphabetically.
<?
// list images in a drop down list
$Dir = "../Prod-Images/Thumbnails";
$mydirectory = opendir("$Dir");
while($entryName = readdir($mydirectory)) {
if ($entryName[0] != "." && $entryName != "." && $entryName !=
".." &&
$entryName != "WS_FTP.LOG" && $entryName != "NA.gif" &&
$entryName !=
"NA.jpg") {
PRINT "<option value=\"$entryName\">" .
"$entryName</option>\n";
}
}
closedir($mydirectory);
?>
I've looked through old messages on the subject but even though on Win32 it
lists in the right way but not on the Apache Webserver.
Thanks.
Martin.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net