Learning the PHP function getimagesize(). Not only does this function get the size of an image, it gets the info of the file and of Flash files.
I used this function to set the layout of the images and Flash files on my portfolio site.
3 Nov 2008.
Really simple. Just tested the function by listing all the items in the array.
Here’s the code. Please link back here if you’re using it.
Put this PHP in the body tag, where you want the text to appear.
$size=getimagesize("http://www.ivanwlam.com/flash/index/080207-screen.swf");
echo "width (index 0) is: $size[0] <br />";
echo "height (index 1) is: $size[1] <br />";
echo "image type (index 2) is: $size[2]<br />";
echo "text of w/h (index 3) is: $size[3] <br />";
echo "mime (index 'mime') is: $size[mime] <br />";
echo "channels (index 'channels') is: $size[channels] <br />";
echo "bits (index 'bits') is: $size[bits] <br />";