& Lt ;? Php $ img_arrayarray (); $ content1stripslashes ($ content1); if (get_magic_quotes_gpc () $ content1stripslashes ($ content1); echo $ conte
-
-
- $ 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 );
-
- ?>