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 string function sql?

0 Answers  


What type of operation is needed when passing values through a form or an url?

0 Answers  


how much can a 1yr experienced php programmer earn in india?

9 Answers   TCS, Tops Technologies,


what the new feature add in php 7.2?

0 Answers  


hello myself Atul saini completed mca in 2007 due to personal problem i cant do job.now i really search 4 a job.i dont know where i go i think simple think is learn php anyone help me wat i can do for a job. thanks

4 Answers  






Tell me how to find current date and time?

0 Answers  


What are objects in php?

0 Answers  


How to convert a string to uppercase in php?

0 Answers  


what is the difference between GET and POST?

21 Answers   AdVine, Evon Technologies, GVD Infotech, RedAlkemi, SoftSol,


What are the two main string operators?

0 Answers  


How can I reverse sort an array keeping the correlation between the index and value?

2 Answers   Rushmore Consultancy,


What is the php function that removes the first element of the array and returns it?

0 Answers  


Categories