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 polymorphism php?

0 Answers  


Write the code for upload a video file in PHP.How will You Play this in Your Page.?

2 Answers   ASD Lab, Convex Digital,


How can we submit a form without a submit button? What is the use of obj_star?

2 Answers   Rushmore Consultancy,


What is local variable in php?

0 Answers  


How many data types are there in php?

0 Answers  


What is csrf token in php?

0 Answers  


What are the basic steps to store PHP session in to Database?

1 Answers   Rediff,


What is the basic function to search files for lines (or other units of text) that contain a pattern.

0 Answers  


Explain the syntax for ‘foreach’ loop with example.

0 Answers  


Do you know what is the use of rand() in php?

0 Answers  


Which is better php praogramming or cad/cam scope wise and also salaray wise?

0 Answers  


Why laravel is best php framework?

0 Answers  


Categories