I have an url to the image, like $var = http://example.com/image.png
How do I get its dimensions to an array, like array([h]=> 200, [w]=>100)
(height=200, width=100)
?
You can use the getimagesize
function like this:
list($width, $height) = getimagesize('path to image'); echo "width: " . $width . "<br />"; echo "height: " . $height;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With