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";
?>
0 comments:
Post a Comment