<?php list($width, $height, $type, $attr) = getimagesize("plane.jpg"); echo "宽度为:" . $width . "<br>"; echo "高度为:" . $height . "<br>"; /* 图像类型的标记: 1 = GIF,2 = JPG,3 =PNG,4 = SWF,5 = PSD,6 = BMP,7 = TIFF(intel byte order), 8 =TIFF(motorola byte order),9 = JPC,10 = JP2,11 = JPX,12 =JB2,13 = SWC, 14 = IFF,15 = WBMP,16 = XBM。*/ echo "格式为:" . $type . "<br>"; echo "类型为:" . $attr . "<br>"; print_r(getimagesize("plane.jpg")); ?>