如何获取图像的宽度和高度?PHP图像尺寸
我$variable = 'http://site.com/image.png"
想要得到这个图像的宽度$width
和高度$height
。
像: $variable = 'http://site.com/image.png"
$width = '300'; // image width is 300px
$height = '500'; // height is 500px
感谢。
如何获取图像的宽度和高度?PHP图像尺寸
我$variable = 'http://site.com/image.png"
想要得到这个图像的宽度$width
和高度$height
。
像: $variable = 'http://site.com/image.png"
$width = '300'; // image width is 300px
$height = '500'; // height is 500px
感谢。
$variable = 'http://site.com/image.png';
$image = getimagesize($variable);
$width = $image[0];
$height = $image[1];
$type = $image[2];
getimagesize功能。也许它会帮助你。
它是你的网站吗? – 2010-08-18 08:44:13
无论如何,这里有一点点神奇:http://google.com/search?q=PHP+image+dimension – 2010-08-18 08:45:14
可能的重复[最快的方式来动态检索图像尺寸](http://stackoverflow.com/questions/ 3334097 /最快方式动态检索图像尺寸) – 2010-08-18 08:46:35