How to get image size (width and height) with PHP

2 Answers

0 votes
$image_array = getimagesize("http://cprogramming.bootzlabs.com/images/ipage.png");
     
echo "width: " . $image_array[0] . "<br />";
echo "height: " . $image_array[1] . "<br />";
echo $image_array[3] . "<br />";
     
/*
run:

width: 157
height: 600
width="157" height="600"

*/

 



answered Dec 6, 2015 by avibootz
0 votes
list($width, $height) = getimagesize("http://cprogramming.bootzlabs.com/images/ipage.png");

echo "width: " . $width . "<br />";
echo "height: " . $height . "<br />";
     
/*
run:

width: 157
height: 600

*/

 



answered Dec 6, 2015 by avibootz

Related questions

3 answers 346 views
2 answers 352 views
1 answer 191 views
1 answer 232 views
1 answer 382 views
1 answer 199 views
...