note 13889 added to ref.dir.php
| From: | wildpeaks at warpdawg dot com | Date: | Sun, 08 Jul 2001 23:18:58 +0000 |
| Subject: | note 13889 added to ref.dir.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15105@lists.php.net to get a copy of this message | ||
Pour lister tous les fichier d'un répertoire; les résultats sont renvoyés sous forme de
tableau:
function listFiles($dir)
{
$x = 0;
if(is_dir($dir))
{
$thisdir = dir($dir);
while($entry=$thisdir->read()) {if(($entry!='.')&&($entry!='..'))
{$result[$x] = $entry; $x++;} }
}
return $result;
}
http://www.php.net/manual/fr/ref.dir.php