note 29966 added to ref.dir
| From: | johnpipi at hotmail dot com | Date: | Sun, 02 Mar 2003 16:22:32 +0000 |
| Subject: | note 29966 added to ref.dir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-44742@lists.php.net to get a copy of this message | ||
Here is a function that returns an array of all files (filenames) from inputted directory.
function getDirFiles($dirPath)
{
if ($handle = opendir($dirPath))
{
while (false !== ($file = readdir($handle)))
if ($file != "." && $file != "..")
$filesArr[] = trim($file);
closedir($handle);
}
return $filesArr;
}
--
http://www.php.net/manual/en/ref.dir.php
http://master.php.net/manage/user-notes.php?action=edit+29966
http://master.php.net/manage/user-notes.php?action=delete+29966
http://master.php.net/manage/user-notes.php?action=reject+29966