note 12163 deleted from class.dir by jimw

From: Date: Sat, 08 Dec 2001 21:07:33 +0000
Subject: note 12163 deleted from class.dir by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-22190@lists.php.net to get a copy of this message
To have the files sorted, you can use something like this (lists all files (not dirs) in directory alphabetically, in a table. Modify it for your own needs: $i=0; $directorio=opendir("."); while ($entrada=readdir($directorio)){ if( (is_dir($entrada)==FALSE)){ $array[$i]=$entrada; $i++; } } sort($array); echo ("<table border=\"1\">"); for ($j=0;$j<=$i;$j++){ echo ("<tr><td> ".$array[$j]." </td><td> "); echo ("blah"); //or readfile($array[$j]);,etc echo ("</td></tr>"); } echo("</table>"); closedir($directorio); Enjoy life w/ php, greetings,ZenZei P.S: this code is problably optimize-able...

« previous php.notes (#22190) next »