note 81969 deleted from function.scandir by felipe
| From: | felipe@php.net | Date: | Fri, 29 Aug 2008 23:28:18 +0000 |
| Subject: | note 81969 deleted from function.scandir by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-144009@lists.php.net to get a copy of this message | ||
Note Submitter: swaitch
----
This script worked perfectly for me in removing the . and .. plus made the files into links for
quick viewing. Might be handy.
<?php
$dir = '../quickhelp/Accounts'; // Your Directory
$files = scandir($dir, 0);
for( $ctr = 1; $ctr < sizeof( $files ); $ctr++ ) {
if($files[$ctr] != "." && $files[$ctr] != "..")
print "<li><a href='Accounts/$files[$ctr]'
target='viewer'>$files[$ctr]</a></li>";
}
?>