Php method for obtaining detailed flash size data, php method for obtaining flash size

Source: Internet
Author: User

Php method for obtaining detailed flash size data, php method for obtaining flash size

This example describes how to obtain detailed flash size data from php. 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)

It seems that getimagesize is still very powerful, and all kinds of image files can be operated, and php is becoming more and more popular.

Related Article

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.