note 42417 deleted from function.readdir by tomsommer
| From: | tomsommer@php.net | Date: | Sun, 16 May 2004 00:04:27 +0000 |
| Subject: | note 42417 deleted from function.readdir by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-69655@lists.php.net to get a copy of this message | ||
Note Submitter: jasper_212@hotmail.com
----
easy script:
maps: top, sorted(ABC)
files: bottom, sorted(ABC)
<?
$dir = @opendir('.');
while (false !== ($bestand = readdir($dir))) {
$explode_bestand = explode('.', $bestand);
$count_array = count($explode_bestand);
if ($count_array == 1) {
$mappenlijst[] = $bestand;
}
if ($count_array != 1 && $bestand != '.' && $bestand != '..') {
$bestandenlijst[] = $bestand;
}
}
closedir($dir);
asort($mappenlijst);
while (list($key, $val) = each($mappenlijst)) {
echo $val.'<br>';
}
asort($bestandenlijst);
while (list($key, $val) = each($bestandenlijst)) {
echo $val.'<br>';
}
?>