Home > php教程 > php手册 > php 获取图片高宽与宽度代码

php 获取图片高宽与宽度代码

WBOY
Release: 2016-06-13 09:48:33
Original
881 people have browsed it

php 获取图片高宽与宽度代码 在php中要获取图片的高与宽度,php自身带有一个函数getimagesize,他会返回一个数组,数组下标1为图片高度,数组下标0一宽度哦。

php教程 获取图片高宽与宽度代码
在php中要获取图片的高与宽度,php自身带有一个函数getimagesize,他会返回一个数组,数组下标1为图片高度,数组下标0一宽度哦。
*/
//you do not need to alter these functions

function getheight($image) {
 $size = getimagesize($image);
 $height = $size[1];
 return $height;
}


//you do not need to alter these functions

function getwidth($image) {
 $size = getimagesize($image);
 $width = $size[0];
 return $width;
}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template