中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

使用PHP下載CSS文件中的圖片的代碼

2018-07-20    來源:open-open

容器云強(qiáng)勢(shì)上線!快速搭建集群,上萬Linux鏡像隨意使用
    <?php   
    //note 設(shè)置PHP超時(shí)時(shí)間   
    set_time_limit(0);   
      
    //note 取得樣式文件內(nèi)容   
    $styleFileContent = file_get_contents('images/style.css');   
      
    //note 匹配出需要下載的URL地址   
    preg_match_all("/url((.*))/", $styleFileContent, $imagesURLArray);   
      
    //note 循環(huán)需要下載的地址,逐個(gè)下載   
    $imagesURLArray = array_unique($imagesURLArray[1]);   
    foreach ($imagesURLArray as $imagesURL) {   
    file_put_contents(basename($imagesURL), file_get_contents($imagesURL));   
    }   
    ?>   

標(biāo)簽:

版權(quán)申明:本站文章部分自網(wǎng)絡(luò),如有侵權(quán),請(qǐng)聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點(diǎn)!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請(qǐng)與原作者聯(lián)系。

上一篇:php 抓取圖片

下一篇:PHP 獲取客戶端ip