Home > Backend Development > PHP Tutorial > How to get flash size detailed data in php

How to get flash size detailed data in php

黄舟
Release: 2023-03-05 22:56:01
Original
1271 people have browsed it

The example in this article describes the method of obtaining flash size detailed data in PHP. Share it with everyone 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 to achieve this. This function is getimagesize, which can return the size and file of the image. An array of type.

If you still want to get the size information of the flash file by parsing the swf file header information, it is really a bit far, because starting from PHP 4, the getimagesize function has been built-in to do this. Thing, 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 a Used for height/width text strings in IMG tags in ordinary HTML files, and starting from PHP 4.0.5, the parameter is also supported to be a url, for example:

$url="http://www.google.com.hk/images/srpr/logo4w.png";
print_r(getimagesize($url));
Copy after login



The output result is:

Array
(
  [0] => 550
  [1] => 190
  [2] => 3
  [3] => width="550" height="190"
  [bits] => 8
  [mime] => image/png
)
Copy after login



Let’s look at an example of getting the flash file size:

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



The output results are as follows:

Array
(
  [0] => 540
  [1] => 250
  [2] => 13
  [3] => width="540" height="250"
  [mime] => application/x-shockwave-flash
)
Copy after login


The above is the content of the method of obtaining flash size detailed data in PHP. Please pay attention to more related content. PHP Chinese website (www.php.cn)!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template