How does php replace the string with a piece of randomly changed content? in the middle of the night, there is no way to sleep, lie in the sky and see the tears, let the cold wind blow, the cold dream, can't get together with you, love each other too bitter, I don't want to fall into this fire. I hope I can forget my sweet dream.
Replace the image code format with the format [img] http://www.csdn.net/siteurl/1.jpg[/img].
Id = ""
Alt = ""
Is a random change.
Reply to discussion (solution)
Replace the image code format with the format [img] http://www.csdn.net/siteurl/1.jpg[/img].
$ S = <HTML in the middle of the night, there is no way to sleep, lie in the sky and see the tears, any cold wind blowing, cold dream, can't get together with you, love each other too bitter, I don't want to fall into this fire. I hope I can forget my sweet dream. HTML; echo preg_replace ('/(id | alt) = ".*? "/',' $1 =" "', $ s );In the middle of the night, you can't sleep, lie down and watch the sky with tears, wind or wind, cold dream, can't get together with you, love each other is too bitter, don't want to fall into this fire, I hope to forget the sweet dream.
Thank you! Resolved