好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

php下载css中图片代码 - php上传下载

php下载css中图片代码

提供一个常见的php下载css中图片代码,只要把$url填写好就行了,代码如下:

<?php  $url  =  'http://www.phpfensi.com' ;   $data  =  file_get_contents ( 'abc.css' );   preg_match( '/(.*//.*?)//' , $url , $host );   $host  =  $host [1];   if  (! is_dir ( 'img' )) {  mkdir ( 'img' ); }   $regex  =  '/url(' {0,1} "{0,1}(.*?)'{0,1}" {0,1})/';   preg_match_all( $regex , $data , $result );   foreach  ( $result [1]  as   $val ) {   if  (preg_match( '/^http.*/' , $val )) {  $target  =  $val ; }   else   if  (preg_match( '/^/.*/' , $val )) {  $target = $host . $val ; }   else  {  $target = $url . $val ; }   echo   $target . "<br/>rn" ;   preg_match( '/.*/(.*.D+)$/' , $val , $name );   if  (! is_file ( './img/' . $name [1])) {   copy ( $target , './img/' . $name [1]);   }   }?> 

查看更多关于php下载css中图片代码 - php上传下载的详细内容...

  阅读:65次