简体   繁体   中英

how can I get the size (height & width) of a image (link) with PHP

How can i get the height and width of an image?

As example i have this link here:

Image

how can i get the size of the image with PHP?

list($width, $height) = getimagesize('path');
This is to find height and width of an image.

list($width, $height, $type, $attr) = getimagesize("image_name.jpg");
echo "Image width " .$width;
echo "<BR>";
echo "Image height " .$height;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM