Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How can we get the properties (size, type, width, height) of
an image using PHP image functions?

Answers were Sorted based on User's Feedback



How can we get the properties (size, type, width, height) of an image using PHP image functions?..

Answer / ansar

exif_imagetype()- for getting type of the image
getimagesize() - for getting size of the image
imagesx - for width
imagesy - for height

Is This Answer Correct ?    32 Yes 6 No

How can we get the properties (size, type, width, height) of an image using PHP image functions?..

Answer / arvind sharma

we can use getimagesize() function which will rtun the array
of its dimension.

Is This Answer Correct ?    9 Yes 2 No

How can we get the properties (size, type, width, height) of an image using PHP image functions?..

Answer / kartihk

getimagesize ( string filename [, array imageinfo])

Returns an array with 4 elements.
Index 0 contains the width of the image in pixels.
Index 1 contains the height.
Index 2 a flag indicating the type of the image. 1 = GIF, 2
= JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel
byte order), 8 = TIFF(motorola byte order, 9 = JPC, 10 =
JP2, 11 = JPX.
Index 3 is a text string with the correct height="yyy"
width="xxx" string that can be used directly in an IMG tag.

<?php
$imgp = getimagesize ("img/flag.jpg");
echo "<img src=\"img/flag.jpg\" {$imgp[3]}>";
?>

Is This Answer Correct ?    9 Yes 2 No

How can we get the properties (size, type, width, height) of an image using PHP image functions?..

Answer / divyesh

getimagesize($size, $type, $width, $hieght);

Is This Answer Correct ?    7 Yes 2 No

Post New Answer

More PHP Interview Questions

What is indexing how many types?

3 Answers   DLF, Infosys, Net Solution, Vcare,


How do you parse and process html/xml in php?

0 Answers  


how to upload more than 50 mb? i tried but session was expired....certain time .....i was set session duration three days .... how to rectified? if any one know that post ur answer as soon as possible?already i was increase php.ini and set Also increase Memory_limit Post_max_size upload_max_filesize..........but not working......

0 Answers  


Tell me what library is used for pdf in php?

0 Answers  


How to strip whitespace (or other characters) from the beginning and end of a string?

0 Answers  


What is split function in php?

0 Answers  


What are the security measures we have to take for our site not to hack by others?

1 Answers   Infosys,


How to pass variables by references?

0 Answers  


What is the meaning of xdebug?

0 Answers  


Do you know how can php and html interact?

0 Answers  


How to create a web form?

0 Answers  


Why php was called as personal home page?

0 Answers  


Categories