How to get flash detail data in PHP

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.