note 42417 added to function.readdir

From: Date: Sat, 15 May 2004 23:07:36 +0000
Subject: note 42417 added to function.readdir
Groups: php.notes 
Request: Send a blank email to php-notes+get-69654@lists.php.net to get a copy of this message
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>'; } ?> ---- Manual Page -- http://www.php.net/manual/en/function.readdir.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42417 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42417&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42417&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#69654) next »