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");
	}
}
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.