note 8957 added to readdir
| From: | trash at python dot or dot kr | Date: | Mon, 09 Oct 2000 07:11:43 +0000 |
| Subject: | note 8957 added to readdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6229@lists.php.net to get a copy of this message | ||
simple algorithm for search all "file" in current directory..
<pre>
<?
$handle=opendir('.');
echo "Directory handle: $handle";
echo "<br>";
echo "Files:\n";
echo "<br>";
while (false!==($file = readdir($handle))) {
if (!is_dir($file)) {
echo "$file";
echo "<br>";
}
}
closedir($handle);
?>
</pre>
http://www.php.net/manual/function.readdir.php