¡¾·±ÌåÖÐÎÄ¡¿
¡¾ÉèΪÊ×Ò³¡¿
¡¾¼ÓÈëÊղء¿
µ±Ç°Î»ÖãºPHP¼¼ÊõÊ×Ò³ >> PHP»ù´¡ >> PHPʵÏÖ·¢±íÎÄÕÂʱ×Ô¶¯±£´æÍ¼Æ¬

PHPʵÏÖ·¢±íÎÄÕÂʱ×Ô¶¯±£´æÍ¼Æ¬

2004-12-15 08:00:00  ×÷Õߣº  À´Ô´£º»¥ÁªÍø  ä¯ÀÀ´ÎÊý£º0  ÎÄ×Ö´óС£º¡¾´ó¡¿¡¾ÖС¿¡¾Ð¡¡¿
¼ò½é£º$img_array = array(); $content1 = stripslashes($content1); if (get_magic_quotes_gpc()) $content1 = stripslashes($content1); //echo $content1; preg_match_all("/(src©¦SRC)="(http://(.+).(gif©¦jpg©¦j...
¹Ø¼ü×Ö£º×Ô¶¯ ÎÄÕ ͼƬ PHP

$img_array = array();

$content1 = stripslashes($content1);

if (get_magic_quotes_gpc()) $content1 = stripslashes($content1);

//echo $content1;

preg_match_all("/(src©¦SRC)="(http://(.+).(gif©¦jpg©¦jpeg©¦bmp©¦png))/isU",$content1,$img_array);

$img_array = array_unique(dhtmlspecialchars($img_array[2]));

set_time_limit(0);

foreach ($img_array as $key => $value) {

$get_file = file_get_contents($value);

$filetime = time();

$filepath = "../uploadfile/".date("Y",$filetime)."/".date("m",$filetime)."/";

!is_dir($filepath) ? mkdirs($filepath) : null;

$filename = date("YmdHis",$filetime).random(1).'.'.substr($value,-3,3);

$fp = @fopen($filepath.$filename,"w");

@fwrite($fp,$get_file);

fclose($fp);

$content1 = preg_replace("/".addcslashes($value,"/")."/isU", "/uploadfile/".date("Y",$filetime)."/".date("m",$filetime)."/".$filename, $content1);

ÔðÈα༭£ºadmin
±¾ÎÄÒýÓõØÖ·£º http://www.3pcode.com/php/2004/12/11112.htm
Ïà¹ØÎÄÕÂ