php Get image height, width and width code_PHP tutorial

WBOY
Release: 2016-07-13 10:45:36
Original
1437 people have browsed it

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...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!