Subscribe For Free Updates!

We'll not spam mate! We promise.

May 5, 2013

Get details about an image in PHP


Get details about of an image in PHP:

The following code is used to get the all details about image by using php and the result will be store in an array.



<?php
$filename = image.jpg; //image file path
$imgDetails = getimagesize($filename);
print_r($imgDetails);
?>

The beloow code is simple to get width and height, type of the image file.


<?php
$img = "images/empty.gif";
list($width, $height, $type, $attr) = getimagesize($img);
print "Width : $width and height = $height";
?> 



TechniqZone Socializer Widget
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment