Home  >  Article  >  Backend Development  >  php getimagesize function gets image size

php getimagesize function gets image size

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


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