Thursday, February 27, 2014

Get image details using PHP


Syntax

list($width, $height, $type, $attr) = getimagesize("image_name.jpg");

Code

This is a sample code, change image_name to your image name and test it!

list($width, $height, $type, $attr) = getimagesize("image_name.jpg");

echo "Image width " .$width;
echo "
";
echo "Image height " .$height;
echo "
";
echo "Image type " .$type;
echo "
";
echo "Attribute " .$attr;

?>
Simple rite :)

No comments:

Related Posts with Thumbnails