Defined
Get the length and width of the picture.
Grammar:
Array getimagesize (string filename, array [imageinfo]);
return value:
Array
Function Type:
Graphics processing
Content Description:
PHP function getimagesize can be used to obtain GIF, JPEG and PNG three kinds of www slices of high and wide, do not need to install the GD library to use this function. The returned array has four elements. The first element of the returned array (index value 0) is the height of the picture, in pixels (pixel).
The second element (index value 1) is the width of the picture. The third element (index value 2) is the file format of the picture, with a value of 1 in GIF format, 2 in jpeg/jpg format, and 3 in PNG format. The fourth element (index value 3) is the height and width of the picture string, Height=xxx width=yyy.
The omitted parameter imageinfo is used to obtain some information about the picture, such as the app13 mark of the IPTC (HTTP://WWW.XE.NET/IPTC), which can be added to the picture, and can be parsed using iptcparse ().
code example for PHP function getimagesize:
- < ? PHP
- function Myimg ($imgfile) {
- $ size getimagesize($imgfile);
- echo " < img src= "$imgfile" $size [3]>";
- }
- Myimg ("Img/img1.gif");
- Myimg ("Img/img2.png");
- ?>
http://www.bkjia.com/PHPjc/446063.html www.bkjia.com true http://www.bkjia.com/PHPjc/446063.html techarticle defines the length of the image to be obtained. Syntax: array getimagesize (string filename, array [imageinfo]); Return value: Array function type: Graphical processing content Description: PHP function getimagesize available ...