This article mainly introduces the method of obtaining detailed data of flash size in PHP, including related usage skills of PHP getimagesize function. Friends in need can refer to it. I hope to be helpful.
The details are as follows:
Sometimes our website needs to obtain the size information of the flash file. PHP has a built-in function to achieve this. This function is getimagesize, which can return the size and file type of the image. An array of.
If you still want to get the size information of the flash file by parsing the header information of the swf file, then it is really a bit far, because starting from PHP 4, the getimagesize function has been built-in to do this. , its function determines the size of any GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP, IFF, JP2, JPX, JB2, JPC, XBM or WBMP image file and returns the dimensions of the image as well as the file type and an available The height/width text string in the IMG tag in an ordinary HTML file, and starting from PHP 4.0.5, the parameter is also supported to be a url, for example:
$url="http://php.cn/images/srpr/logo4w.png"; print_r(getimagesize($url));
The output result is:
Array ( [0] => 550 [1] => 190 [2] => 3 [3] => width="550" height="190" [bits] => 8 [mime] => image/png )
Let's look at another example of getting the flash file size:
$url="http://php.cn/static/api/data/e69b9944a2ce0afc9890f85f10dbcfc3.swf"; print_r(getimagesize($url));
The output results are as follows:
Array ( [0] => 540 [1] => 250 [2] => 13 [3] => width="540" height="250" [mime] => application/x-shockwave-flash )
I feel that getimagesize is still very powerful, and files of various image types can be operated.
Related recommendations:
Strong PHP image processing class
php uses Gaussian algorithm to blur images
How PHP implements image recognition
The above is the detailed content of How to get flash detailed data in php. For more information, please follow other related articles on the PHP Chinese website!