Hi, i've read a few posts similar to this but still couldn't figure out why i'm getting an error:
I have the code that will display a list of files in a directory that are only images, but then i want to adapt it to also give the file sizes i've tried a few methods giving errors such as:
picture.gif (errno=2 - No such file or directory) 😕
even though it would count the files still and display it!
<?
$count=0;
if($d = opendir(""))
{
while(false != ($f = readdir($d)))
{
if(eregi("\.(jpg|png|gif)$", $f))
{
echo "<img src='" . $dir . "/" . $f . "'><br />";
$count++;
}
}
closedir($d);
echo "<p>" . $count . " image(s) </p>";
}
?>
So, any ideas how i can adapt this code to display the file size also?
Would be so greatful if you can help!
Thanks
Ant
P.S. after eregi(" there is a \ but it isn't showing up in the code above.