get image width and height
Posted: Fri Mar 25, 2005 6:31 pm
how can i get a images width and height?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<html>
<body>
<p>
<img src="e;blah.gif"e;
width="e;20"e; height="e;20"e;>
</p>
<p>
<img src="e;blah.gif"e;
width="e;45"e; height="e;45"e;>
</p>
<p>
<img src="e;blah.gif"e;
width="e;70"e; height="e;70"e;>
</p>
//You can make a picture larger or smaller changing the values in the "e;height"e; and "e;width"e; attributes of the
img tag.//
</body>
</html>Code: Select all
$info = getimagesize($image);
//info now contains the dimenisions of the image
echo '<pre>'.print_r($info).'</pre>';