note 74122 deleted from function.readdir by tularis
| From: | tularis@php.net | Date: | Sun, 13 May 2007 18:58:20 +0000 |
| Subject: | note 74122 deleted from function.readdir by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-126492@lists.php.net to get a copy of this message | ||
Note Submitter: sofyan dot adiyatma at gmail dot com
----
function php4_scandir($dir,$listDirectories=false, $skipDots=true) {
$dirArray = array();
if (is_dir("$dir")) {
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." || $skipDots == false) {
#added the $dir. in this line
if($listDirectories == false && is_dir($dir.$file)) { continue; }
array_push($dirArray,basename($file));
}
}
closedir($handle);
}
}
else {
$dirArray[] = '<font
style="text-decoration:line-through;">'.$dir."</font>";
}
return $dirArray;
}