How to obtain flash size detail data _php tips for PHP

Source: Internet
Author: User

This example describes how to obtain flash dimension detail data in PHP. Share to everyone for your reference, specific as follows:

Sometimes our site needs to get the size of the Flash file information, PHP has a built-in function can be implemented, this function is getimagesize, he can return the image size and file type of an array.

If you also want to get the size information of the Flash file by parsing the SWF file header information, that's a bit far away, since PHP 4 starts with the built-in getimagesize function to do this thing, its function is to measure 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 and 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 = "Yun_qi_img/logo4w.png";
Print_r (getimagesize ($url));

The results of the output are:

Array
(
  [0] => [
  1] => 190
  [2] => 3
  [3] => width= "" height= "190"
  [bits] => 8
  [MIME] => image/png
)

Let's look at an example of how to get a Flash file size:

$url = "http://tools.jb51.net/static/api/data/e69b9944a2ce0afc9890f85f10dbcfc3.swf";
Print_r (getimagesize ($url));

The output results are as follows:

Array
(
  [0] => 540
  [1] =>
  [2] =>
  [3] => width= "540" height= "
  [MIME] =>" Application/x-shockwave-flash
)

Feel getimagesize is still very powerful, a variety of image types of files can be manipulated, more and more like PHP.

More about PHP Interested readers can view the site topics: "PHP graphics and pictures Operating skills summary", "PHP file Operation Summary", "PHP Array" operation Skills Encyclopedia, "PHP Basic Grammar Introductory Course", "PHP Operations and Operator Usage Summary", " Introduction to PHP object-oriented programming program, "PHP Network Programming Skills Summary", "PHP string (String) Usage Summary", "Php+mysql database Operation Tutorial" and "PHP common database Operation Skills Summary"

I hope this article will help you with the PHP program design.

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.