display picture size<

liunx

Guest
ok I have this code


<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "<a href='http://www.htmlforums.com/archive/index.php/$file'><img src='http://www.htmlforums.com/archive/index.php/$file' width='100' height='100'>$file</a><br>\n";
}
}
closedir($handle);
}
?>


and it is in a picture directory as the index file. I have it setup so if you view the page it displays all the pictures in the folder and the pictures name next to it. Is there a way to display the size (width X height) in there too? And to make it a little more clear I don't want it to show the picture itself in its full size but I want the actual numbers of the width & height to show up on the page.
Thanks!check <!-- m --><a class="postlink" href="http://nl2.php.net/manual/nl/function.getimagesize.phpBasically">http://nl2.php.net/manual/nl/function.g ... pBasically</a><!-- m --> it would look like this


<?php
$file = 'image.jpg'
$size = getimagesize($file)
echo "<img src=http://www.htmlforums.com/"$file/" width=/"$size[0]/" height=/"$size[1]/">
?>cool. I got it. Thanks A Lot!!
 
Back
Top