Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,882 questions

51,808 answers

573 users

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 311 views
2 answers 332 views
1 answer 172 views
1 answer 207 views
1 answer 361 views
1 answer 162 views
...