How to get flash detailed data in php

*文
Release: 2023-03-18 22:38:01
Original
1613 people have browsed it

This article mainly introduces the method of obtaining detailed data of flash size in PHP, including related usage skills of PHP getimagesize function. Friends in need can refer to it. I hope to be helpful.

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 type of the image. An array of.

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

$url="http://php.cn/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 another example of getting the flash file size:

$url="http://php.cn/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

I feel that getimagesize is still very powerful, and files of various image types can be operated.

Related recommendations:

Strong PHP image processing class

php uses Gaussian algorithm to blur images

How PHP implements image recognition

The above is the detailed content of How to get flash detailed data in php. For more information, please follow other related articles on the PHP Chinese website!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!