Home >Backend Development >PHP Tutorial >php Get image height, width and width code_PHP tutorial

php Get image height, width and width code_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:45:361480browse

php gets the image height and width code To get the height and width of an image in PHP, PHP itself has a function getimagesize, which will return an array. The array subscript 1 is the height of the image, and the array subscript 0 is the width.

php tutorial to get image height, width and width code
To get the height and width of an image in PHP, PHP itself has a function getimagesize, which will return an array. The array subscript 1 is the height of the image, and the array subscript 0 is the width.
*/
//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;
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/633016.htmlTechArticlephp code to get the height and width of the image. To get the height and width of the image in php, php itself has a Function getimagesize, it will return an array, the array subscript 1 is the height of the image, the array...
Statement:
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