You don't need the $count
. This will give you the same result
$list[] = array();
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$list[] = $file;
}
}
Replace sorting and displaying with just:
sort($list);
for ($i = 0; $i < count($list); $i++) {
echo "<li><img src=\"photos/{$list[$i]}\" alt=\"{$list[$i]}\" title=\"\"></li>\n";
}
RaYell
2009-07-28 17:26:36