note 20940 added to function.is-dir
| From: | psf at example dot com | Date: | Mon, 22 Apr 2002 21:28:33 +0000 |
| Subject: | note 20940 added to function.is-dir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-29700@lists.php.net to get a copy of this message | ||
is_dir() function don't work in win32. This metod work:
function get_dirs($dir)
{
$handle=opendir($dir);
while ($file = readdir($handle))
{
if ($file != "." && $file != "..")
if ($aux=@opendir($dir."/".$file))
{
closedir($aux);
$buffer[]=$file;
};
};
closedir($handle);
return $buffer;
}
This return a array with all directories in $dir.
Here a function that work:
function is_direx($dir)
{
if ($aux=@opendir($dir."/".$file))
{
closedir($aux);
return 1;
};
return 0;
};
--
http://www.php.net/manual/en/function.is-dir.php
http://master.php.net/manage/user-notes.php?action=edit+20940
http://master.php.net/manage/user-notes.php?action=delete+20940
http://master.php.net/manage/user-notes.php?action=reject+20940