Home >Backend Development >PHP Tutorial >Example of using php getimagesize function to get image size

Example of using php getimagesize function to get image size

WBOY
WBOYOriginal
2016-07-25 08:51:36813browse
  1. $arr = getimagesize("1.jpg");
  2. /**
  3. * Here $arr is an array type
  4. * $arr[0] is the width of the image
  5. * $arr[1] is the height of the image
  6. * $arr[2] is the format of the image, including jpg, gif, png, etc.
  7. * $arr[3] is the width and height of the image, and the content is width="xxx" height="yyy"
  8. */
  9. /* below The output content of the two lines of code is the same*/
  10. echo "";
  11. echo "";
  12. ?>
Copy code

The above php code is interpreted as the content as follows :



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