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.