-
-
/* 1.jpg is the image whose size you want to get*/
- $arr = getimagesize("1.jpg") ;
- /**
- * Here $arr is an array type
- * $arr[0] is the width of the image
- * $arr[1] is the height of the image
- * $arr[2] is the format of the image, including jpg, gif, png, etc.
- * $arr[3] is the width and height of the image, and the content is width="xxx" height="yyy"
- */
- /* The following two lines of code output the same content*/
- echo "echo "";
- ?> p>
-
Copy the code
After explaining the above code, it will look as follows:
|