How can I find the width and height of an image resource?
Answer Posted / 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 View All Answers
What is html used for?
What do you mean by having php as whitespace insensitive?
Is PHP runs on different platforms (Windows, Linux, Unix, etc.)?
Tell me what does the scope of variables means?
What is substr in php?
What is the functionality of the functions strstr() and stristr()?
How to swap two variables without using 3rd temp variable.
How to reset/destroy a cookie in php?
Tell me how to execute an sql query? How to fetch its result?
How to check an key is exists in array?
What is difference between rest and http?
Do you know what is the use of the function 'imagetypes()'?
How to generate a character from an ascii value?
Distinguish between urlencode and urldecode?
Explain the value of the variable input is a string 1,2,3,4,5,6,7. How would you get the sum of the integers contained inside input?