note 53392 added to function.scandir

From: Date: Tue, 31 May 2005 13:10:30 +0000
Subject: note 53392 added to function.scandir
Groups: php.notes 
Request: Send a blank email to php-notes+get-89677@lists.php.net to get a copy of this message
My small three function <? function three($dir) { $back=&getcwd(); chdir($dir); $hD=&dir('.'); while($line=&$hD->read()) { if($line=='.' || $line=='..')continue; if(!is_File($line))$three[$line]=&three($line); else $three[$line]='file'; } chdir($back); return $three; } print_R(three('.')); /*output Array ( [same.file] => file [samefile.txt] => file [samedir] => Array ( [samesubdir] => Array ( ) ) [samefile2.jpg] => file [samedir2] => Array ( [samesubfile.php] => file ) [samefile3.txt] => file ) */ ?> ---- Manual Page -- http://www.php.net/manual/en/function.scandir.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+53392 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53392&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53392&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53392&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53392&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53392&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+53392&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#89677) next »