Below is an example of how to get the image properties from a remote server/website using getimagesize() function of PHP.
The output for the above script will return image width, height, type, etc as below.
$url = 'http://static.php.net/www.php.net/images/php.gif';
$size = getimagesize( $url );
print_r($size);
The output for the above script will return image width, height, type, etc as below.
Array
(
[0] => 120
[1] => 67
[2] => 1
[3] => width="120" height="67"
[bits] => 7
[channels] => 3
[mime] => image/gif
)
Comments