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 namespace and use in php?

0 Answers  


What does accessing a class via :: means?

1 Answers  


How to change the principal password?

0 Answers  


What are different ways to redirect from on page to other?

9 Answers  


What is url encoding and decoding in php?

0 Answers  






Tell us how can we display the output directly to the browser?

0 Answers  


What is json php?

0 Answers  


How to create a text file in PHP?

0 Answers  


How to connect SMTP server in php. I want to edit that in mantiss bug tracking tool. If anyone worked on mantiss software or in php, please give answer . I need to modify that in mantiss software.

1 Answers   HCL, UHG,


How is it possible to set an infinite execution time for php script?

0 Answers  


What is difference between put and post method in http?

0 Answers  


What are the advantages of triggers in php?

0 Answers  


Categories