note 12153 deleted from function.opendir by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 23:43:24 +0000 |
| Subject: | note 12153 deleted from function.opendir by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22363@lists.php.net to get a copy of this message | ||
You might find this code useful... it lists all files in a given directory, and assumes they are
images (.gif or .jpg). It then gets the dimensions, and displays them next to them.
$dir=opendir "/image directory/");
while ($file = readdir($dir)) {
if ($file != "." && $file != ".."){
// Get sizes...
$size=GetImageSize("/image directory/$file");
$width=$size[0];
$height=$size[1];
print "$file ($width x $height)";
}
closedir($dir);