问题解决了:用getimagesize()这个函数,它不只支持图片,还支持flash等很多类型.
$t = getimagesize("aa.swf");
$width  = $t[0];
$height = $t[1];The getimagesize() function will determine the size of any GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP, IFF, JP2 or JPC image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag. The getimagesize() function will determine the size of any GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP, IFF, JP2 or JPC image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag. 

解决方案 »

  1.   

    有个问题:
    这个getimagesize有时能够取出flash的长宽,但有时却不行,同样是flash为什么就不行呀.
      

  2.   

    flash 5 以下版本的可能读出长宽度,但是flash 5以上就读不出.
    谁来帮忙解决这个问题.
      

  3.   

    array getimagesize ( string filename [, array imageinfo])
    getimagesize() 函数将测定任何 GIF,JPG,PNG,SWF,SWC,PSD,TIFF,BMP,IFF,JP2,JPX,JB2,JPC,XBM 或 WBMP 图像文件的大小并返回图像的尺寸以及文件类型和一个可以用于普通 HTML 文件中 IMG 标记中的 height/width 文本字符串。 注: 对 JPC,JP2,JPX,JB2,XBM 和 WBMP 的支持自 PHP 4.3.2 起可用。对 SWC 的支持自 PHP 4.3.0 起可用。 返回一个具有四个单元的数组。索引 0 包含图像宽度的像素值,索引 1 包含图像高度的像素值。索引 2 是图像类型的标记: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。这些标记与 PHP 4.3 新加的 IMAGETYPE 常量对应。索引 3 是文本字符串,内容为“height="yyy" width="xxx"”,可直接用于 IMG 标记。