如何用PHP获取图像(链接)的大小(高度和宽度)

时间:2015-05-12 13:06:09

标签: php html

如何获得图像的高度和宽度?

例如我在这里有这个链接:

Image

如何用PHP获取图像的大小?

2 个答案:

答案 0 :(得分:2)

list($width, $height) = getimagesize('path');

答案 1 :(得分:2)

This is to find height and width of an image.

list($width, $height, $type, $attr) = getimagesize("image_name.jpg");
echo "Image width " .$width;
echo "<BR>";
echo "Image height " .$height;