开发者

PHP image dimension

How to get width and height of an image?

I have $variable = 'http://site.com/image.png"

Want to get width of this image to $width and height to $height.

Like: $variable = 'http://site.com/image.png"

$width = '300'; // image width is 300px
$height = '500'; // height is 500px

Thank开发者_如何学JAVAs.


$variable = 'http://site.com/image.png';
$image    = getimagesize($variable);
$width    = $image[0];
$height   = $image[1];
$type     = $image[2];


getimagesize function. Maybe it will help you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜