note 37112 deleted from class.dir by aidan

From: Date: Sun, 05 Sep 2004 07:22:17 +0000
Subject: note 37112 deleted from class.dir by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-76042@lists.php.net to get a copy of this message
Note Submitter: daemon at freemail dot lt ---- I used this simple alg to list * files. Works fine on XP ;) <? function listdir($dir) { function ls_recursive($dir) { if (is_dir($dir)) { $dirhandle=opendir($dir); while(($file = readdir($dirhandle)) !== false) { if (($file!=".")&&($file!="..")) { $currentfile=$dir."/".$file; echo $currentfile."<br>"; if(is_dir($currentfile)) { ls_recursive($currentfile); } } } } } echo $dir."<br>"; ls_recursive($dir); } //main { $dir="c:/"; listdir($dir); echo "All done."; } ?>

« previous php.notes (#76042) next »