url_image_size

Description

Uses getimagesize() to determine the size of a file.

Syntax

array url_image_size (string $url)



Parameter $url

Expected type: String
Description: The URL to the image we want to know the size of



Return value

Expected type: Array
Description: Returns false on failure; see http://www.php.net/getimagesize for more info on possible return values

Array Elements
Key Optional Expected type Description
0 no Integer The width of the image, in pixels
1 no Integer The height of the image, in pixels
2 no Enumerated String Flag indicating what type of image this is (see http://www.php.net/image#image.constants)
3 no String The 'height="yyy" width="xxx"' string that can be used for the HTML img tag


Notes

  • Attempts to connect to the server first so it won't time out.
  • Returns false on failure, otherwise the output of getimagesize().
Advertisement: