This article mainly introduces the method of obtaining the detailed data of flash size in PHP, involving the use of PHP getimagesize function, the need for friends to refer to. We hope to help you.
Specific as follows:
Sometimes our website needs to get the size information of the Flash file, PHP has a built-in function can be implemented, this function is getimagesize, he can return the size of the image and the file type of an array.
If you still want to get the size information of the Flash file by parsing the SWF file header information, it's really a bit far away, since PHP 4 has built-in getimagesize function to do this thing, its function to determine any GIF,JPG,PNG,SWF,SWC,PSD, TIFF,BMP,IFF,JP2,JPX,JB2,JPC,XBM or WBMP the size of the image file and returns the size of the image as well as the file type and a height/width text string that can be used in an IMG tag in a normal HTML file, and from PHP 4.0.5 also supports the parameter is a URL, for example:
$url = "Http://php.cn/images/srpr/logo4w.png";p Rint_r (getimagesize ($url));
The result of the output is:
Array ( [0] = 550 [1] = [ 2] = 3 [3] = width= "550" height= "" [bits] = 8 [MIME] = image/png)
Take a look at an example of getting the Flash file size:
$url = "http://php.cn/static/api/data/e69b9944a2ce0afc9890f85f10dbcfc3.swf";p Rint_r (getimagesize ($url));
The output results are as follows:
Array ( [0] = 540 [1] = [ 2] = [3] = width= "540" height= " [MIME] = appli Cation/x-shockwave-flash)
Feel getimagesize is still very powerful, all kinds of image types of files can be manipulated.
Related recommendations:
Very strong PHP image processing class
PHP blurs images using Gaussian algorithm
How PHP implements image recognition