获取图片尺寸 [英] Get image dimensions
本文介绍了获取图片尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个图片的网址,例如 $ var = http://example.com/image.png
I have an url to the image, like $var = http://example.com/image.png
如何将其尺寸添加到数组,类似 数组([h] => 200,[w] => ; 100)
(身高= 200,宽度= 100)
?
推荐答案
您可以使用 getimagesize
这样的功能:
You can use the getimagesize
function like this:
list($width, $height) = getimagesize('path to image');
echo "width: " . $width . "<br />";
echo "height: " . $height;
这篇关于获取图片尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文