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's the best method for sanitizing user input with php?
What does mvc stand for and what does each component do?
Which is incorrect with respect to separating php code and html?
What is var_dump function in php?
Where are cookies stored php?
How can you retrieve a cookie value?
How can we calculate the similarity between two strings?
What does $this do in php?
Does exist in php?
Explain how does one prevent the following warning ‘warning: cannot modify header information – headers already sent' and why does it occur in the first place?
Explain php parameterized functions.
How to change the principal password?
Difference between $message vs. $$Message in php.
What are objects in php?
What does namespace mean in php?