|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
$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); 返回类别: 教程 上一教程: 如何在PHP中使用Oracle数据库(1) 下一教程: 在线增减.htpasswd内的用户 您可以阅读与"PHP实现发表文章时自动保存图片"相关的教程: · PHP实现自动刷数和“灌水”机 · 用PHP+java实现自动新闻滚动窗口 · php生成SessionID和图片校验码的思路和实现 · PHP中实现大图自动缩成小图(及GD库的安装) · 用PHP和MySQL保存和输出图片 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |