I've been trying all day to get variants of this to work.
<?php
if ($handle = opendir('./mydirectory')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file , filesize($file)<br />";
}
}
closedir($handle);
}
?>
I CAN get the file listing, but the filesize function just isn't working - it simply outputs
thefile.zip,filesize(thefile.zip)
Any ideas where I'm going wrong?
I'm trying to get a side by side listing to turn this into a CSV and import it into an existing database. With over a thousand files I'd like to shorten this with a script if possible.
Thanks for any help.