How to replace a random string in php?-php Tutorial

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.