Home  >  Article  >  Backend Development  >  Example of using the php getimagesize function to obtain the image size

Example of using the php getimagesize function to obtain the image size

WBOY
WBOYOriginal
2016-07-25 08:52:301021browse
  1. /* 1.jpg To get the image of its size*/
  2. $arr = getimagesize("1.jpg");
  3. /**
  4. * $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 two The output content of each line of code is the same*/
  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