|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-01-26 23:18 UTC] php3_bug_report at pepsi dot itgo dot com
your example script:
<?php
$handle=opendir('.');
echo "Directory handle: $handle\n";
echo "Files:\n";
while ($file = readdir($handle)) {
echo "$file\n";
}
closedir($handle);
?>
the directory listing:
drwxr-xr-x 4 userr users 1024 Jan 27 04:57 ./
drwxr-xr-x 3 userr users 1024 Jan 17 12:04 ../
drwxr-xr-x 2 userr users 1024 Jan 27 04:55 Bilder/
-rw-r--r-- 1 userr users 29184 Jun 24 1999 call-by-call.xls
-rw-r--r-- 1 userr users 185 Dec 15 20:29 index.alt
drwxrwxrwx 2 userr users 1024 Jan 27 04:55 uploads/
what I get:
.
..
uploads
call-by-call.xls
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 10 23:00:01 2026 UTC |
Change while ($file = readdir($handle)) { to while (($file = readdir($handle)) != "") {