Newbie: Question about filesize()
| From: | Manuel Ritsch | Date: | Thu, 31 Jan 2002 21:14:03 +0000 |
| Subject: | Newbie: Question about filesize() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-82994@lists.php.net to get a copy of this message | ||
Hello There
I'm new to PHP and trying to code a function that reads all teh files out of
a directory and printing out a link and the filesize,
but it seems that the filesize() function doesn't work, here's the code so
far:
$handle = opendir ('images');
echo "Files:<br><br>";
while (false !== ($file = readdir ($handle))) {
if($file != "." && $file != "..")
{
$file_s = filesize($file);
echo "<a href=images/$file>$file</a> Filesize:
$file_s<br>";
}
}
closedir($handle);
and the output is somethingl ike this:
Files:
button_test_04.gif Filesize:
button_test_03-down.gif Filesize:
lilextras_01.gif Filesize:
(and so on)...
You see, there's no Filesize and I don't know why, please help me
-- manu