Tutorial Get Width/Height of Image

by in , 0

If all you have for an image is the URL, you can still find the dimensions:

<?php

  list($width, $height, $type, $attr) = getimagesize("url/to/image.jpg");

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

?>

Reference URL

Leave a Reply