Hi Im looking for a way to check what the dimensions of an image are using PHP. I need to work out what the width and height are of an image which can be passed to PHP using a URL. Can anyone help? Thanks Phil
I don't think that php has function that can get dimensions of remote image. One way to get dimenstions: Download image file with php and check dimensions with GD(http://www.php.net/gd).
<?php $info = getimagesize("http://www.google.com/intl/en_ALL/images/logo.gif"); echo $info[3]; ?> Code (markup): I'm only displaying the Array[3], but there are your other options too, I tested it with Google's Logo. Array[0] = Width Array[1] = Height Array[2] = Image Type Flag Array[3] = width="xxx" height="xxx" Array[bits] = bits Array[channels] = channels Array[mime] = mime-type