As a senior and professional Skinner personnel, I began to invest in the great Internet from the beginning to now accumulated a wealth of Skinner experience. I'm sure every web programmer will have a similar experience.
In the Skinner process, it is essential to download the pictures in the style file. When you encounter a larger style file, which may have hundreds of pictures to download, it is most appropriate to use this small piece of code below.
< PHP
/*
More & Original PHP framwork
Copyright (c) 2007-2008 Ismole Inc.
Author:kimi
Documentation: Download the pictures in the style file, water-specific Skinner tools
*/
Note Set the PHP timeout time
Set_time_limit (0);
Note To get the contents of the style file
$styleFileContent = file_get_contents (' images/style.css ');
The note matches the URL address that needs to be downloaded
Preg_match_all ("/url\ (. *) \)/", $styleFileContent, $imagesURLArray);
Note Cycle need to download the address, download one by one
$imagesURLArray = Array_unique ($imagesURLArray [1]);
foreach ($imagesURLArray as $imagesURL) {
File_put_contents (basename ($imagesURL), file_get_contents ($imagesURL));
}