- <?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)./.$filename, $content1);
- ?>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。