note 59953 deleted from ref.dir by nlopess
| From: | nlopess@php.net | Date: | Wed, 21 Dec 2005 20:20:17 +0000 |
| Subject: | note 59953 deleted from ref.dir by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-100540@lists.php.net to get a copy of this message | ||
Note Submitter: e-5 at webhostingjournal dot net
----
Quick directory listing in alphabetical order:
<?php
$dir_path = '.';
$dir_list = array();
if ($handle = opendir($dir_path)) {
while ($files = readdir($handle)) {
if (preg_match("/^\./",$files)==0) $dir_list[] = $files; //echo
$files.'<br>';
}
closedir($handle);
asort($dir_list);
echo '<h3>Directory Listing</h3><ul>';
foreach ($dir_list as $value) {
echo '<li>'.$value.'</li>';
}
echo '</ul>';
}
?>
From this snippet and other "Directory Functions" you may extend to even more
functionality.
----
Melvin D. Nava
http://www.webhostingjournal.net/