Here is the code I am using to display whatever is in a folder including other folders is there any way.
This in it current form sorts the files alphabetacly is there any way to sort the the files alphabeticly by there extenstion, like .txt files or .exe?
here is the code
<TABLE ALIGN=CENTER BGCOLOR=#E4E4E4 CELLPADDING=4 CELLSPACING=0 border=0 >
<tr><th>File</th><th>Size
</th>
</tr>
<?php
$dir="./";
if (is_dir($dir)) {
$fd = @opendir($dir);
if($fd) {
while (($part = @readdir($fd)) == true) {
if ($part != "." && $part != "..") {
$file_array[]=$part;
}
}
}
sort($file_array);
reset($file_array);
for($i=0;$i<count($file_array);$i++) {
$npart=$file_array[$i];
if (!strstr($npart,".inc") && !strstr($npart,"index.php")) {
$fsize=filesize($npart)/1000;
if (is_dir($npart)) {
print("<tr><td><a href=\"$npart\">$npart</a></td><td>Directory</td></tr>\n");
} else {
print("<tr><td><a href=\"$npart\">$npart</a></td><td>$fsize KB</td></tr>\n");
}
}
}
}
?>
</table>
thanks in advance