php 获取图片高宽与宽度代码
在php中要获取图片的高与宽度,php自身带有一个函数getimagesize,他会返回一个数组,数组下标1为图片高度,数组下标0一宽度.
php 获取图片高宽与宽度代码如下:
function getheight($image) {
$size = getimagesize($image);
$height = $size[1];
return $height;
}
function getwidth($image) {
$size = getimagesize($image);
$width = $size[0];
return $width;
}教程地址:https://www.phprm.com/tuxiang/fs4465.html
欢迎转载!但请带上文章地址^^