Jump to content

[SOLVED] List and Split Problem


BrandonE97

Recommended Posts

<?php
print("<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\" class=\"whitelinks\">\n");
print("<tr><th>Filename</th><th>Filetype</th><th>Filesize</th></tr>\n");
// loop through the array of files and print them all
for($index=0; $index < $indexCount; $index++) {
             // this if was in the original code I found and hides the "." ".." and ".htaccess" from showing in the listing
if (substr("$dirArray[$index]", 0, 1) != ".") {
	list($fname, $fext) = explode('.', $dirArray['$index']);
                         // the $IGfname and $IGfext are arrays of names/extensions not to show in the listing
	if ($fname != $IGfname || $fext != $IGfext) {
		print("<tr><td><a href=\"$DLdir$dirArray[$index]\" target=\"_blank\">$dirArray[$index]</a></td>");
		print("<td>");
		print($fext);
		print("</td>");
		print("<td>");
		// this is using a function to give the size in bytes, kb, mb, or gb
		print(myFileSize(filesize("$DLdir$dirArray[$index]")));
		print("</td>");
		print("</tr>\n");
	}
}
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.