Introduction: This is the PHP implementation.ArticleThe detailed page for automatically saving images at the time, describes the related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 323997 'rolling = 'no'>
$ 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 );
More articles about "automatically saving pictures when publishing articles in PHP"
Love J2EE follow Java Michael Jackson video station JSON online tools
Http://biancheng.dnbcw.info/php/323997.html pageno: 15.