note 13607 deleted from class.dir by jimw

From: Date: Sat, 08 Dec 2001 21:07:49 +0000
Subject: note 13607 deleted from class.dir by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-22192@lists.php.net to get a copy of this message
Here's a script to read the full contents of a directory, and display links to the respective files/folders in alphabetical order: $i = 0; $d = dir("./"); $dir = getcwd(); list($crap, $dir) = split("$dir/", $dir); while($entry=$d->read()) { if ($entry != "." && $entry != ".htaccess" && $entry != "index.php" && $entry != "cgi-bin") { $enter[$i] = $entry; $i++; }; }; sort($enter); for ($j=0;$j<$i;$j++){ echo("<a href=\"$enter[$j]\"".">".$enter[$j]."</a><br>\n"); }; $d->close();

« previous php.notes (#22192) next »