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 exactly is validating and sanitizing?
Which cryptographic functions in php returns the longest hash value?
What types of Data Can Be Used as Array Keys?
How a variable is declared in php?
What are the difference between array_keys() and array_key_exists() in php?
How to connect to a url in php?
How to convert the first character to upper case?
Which is faster for or foreach php?
What are the common uses of php?
What is an object in php?
Does php support multiple inheritance?
What are the special characters you need to escape in single-quoted stings?
Is variable name casesensitive in php?
What is the difference between $name and $$name?
What is mvc in php?