This example describes how to obtain detailed flash size data from php. Share it with you for your reference. The details are as follows: sometimes our website needs to obtain the size information of flash files. php has a built-in function that can be implemented. This function is getimagesize, it returns an array of the image size and file type. if you still want to retrieve the flash file by parsing the swf file header information, this article describes how php obtains detailed flash size data. We will share this with you for your reference. The details are as follows:
Sometimes our website needs to obtain the size information of the flash file. php has a built-in function that can be implemented. This function is getimagesize, which can return an array of the image size and file type.
If you still want to parse the swf file header information to obtain the size information of the flash file, it is a little too far away, because the getimagesize function has been built into PHP 4 to do this, its function is used to determine any GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP, IFF, JP2, JPX, JB2, JPC, the size of the XBM or WBMP image file, the size of the returned image, the file type, and a height/width text string that can be used in the IMG mark of a common HTML file, in addition, a url is also supported from PHP 4.0.5, for example:
$url="http://www.google.com.hk/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 take a look at an example of getting the flash file size:
$url="http://tools.jb51.net/static/api/data/e69b9944a2ce0afc9890f85f10dbcfc3.swf";print_r(getimagesize($url));
The output result is as follows:
Array( [0] => 540 [1] => 250 [2] => 13 [3] => width="540" height="250" [mime] => application/x-shockwave-flash)
The above is the content of php's method for obtaining detailed flash size data. For more information, see PHP Chinese network (www.php1.cn )!