The Sea King Posted March 13, 2008 Share Posted March 13, 2008 I got the code that lists the files: <?phpif ($handle = opendir('.')) {echo "<ul>";while (false !== ($file = readdir($handle))) {echo "<li><a href='$file'>$file</a> - </li>";}echo "</ul>";closedir($handle);}?> But I also want it to say it's size. I found this: filesize() but I don't know where to put it. Help? Link to comment Share on other sites More sharing options...
Wander Posted March 13, 2008 Share Posted March 13, 2008 put the filesize($file) in the while loopfor example:<?phpif ($handle = opendir('.')) {echo "<ul>";while (false !== ($file = readdir($handle))) {echo "<li><a href='$file'>$file</a> Size: ".filesize($file)." </li>";}echo "</ul>";closedir($handle);}?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.