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 the difference between echo, print and printf()?
Which function is used in php to search a particular value in an array?
What good is polymorphism?
Why do we use javascript in php?
How can we change the maximum size of the files to be uploaded?
Explain php explode() function.
Is not null in php?
What are the features of php 7?
Tell me what are sql injections, how do you prevent them and what are the best practices?
Can I use php in html?
What is the use of final class in php?
What is the difference between php and javascript?
Explain what are some new features introduced in php7?
What function do we use to find length of string, and length of array?
Where php language is used?