How can I find the width and height of an image resource?

Answers were Sorted based on User's Feedback



How can I find the width and height of an image resource? ..

Answer / laxmikant

getimagesize();

Is This Answer Correct ?    5 Yes 3 No

How can I find the width and height of an image resource? ..

Answer / jude jeevanraj.p

It is often useful to know the width and height of an image
resource. This can be achieved with the functions imagesx
and imagesy, like this:

<?php
$img = imagecreatetruecolor(400, 100);
echo imagesx($img); // 400
echo imagesy($img); // 100
?>

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More PHP Interview Questions

What is regex in html?

0 Answers  


What is string and its function?

0 Answers  


What are the uses of php language?

0 Answers  


What is php oop?

0 Answers  


What is a query in php?

0 Answers  






What sized websites have you worked on in the past?

0 Answers  


How is csrf token generated?

0 Answers  


What is variable give example?

0 Answers  


What is a persistence cookie?

0 Answers  


What are advantages of .htaccess?

0 Answers  


find highest salary

8 Answers  


What is whitespace in html?

0 Answers  


Categories