Help Ah urgently remove a paragraph of URL want to use & nbsp; this function & nbsp; preg_replace & nbsp; remove a paragraph & nbsp; such as: jackie. cai free collar Ah http://www.ndjj.com/product.php? Product_no = 842, the product is really good! There are more than N free trial products in Xishi. for help, please remove the URL in a paragraph.
Would like to use this function preg_replace to remove a paragraph such as: jackie. cai free collar Ah http://www.ndjj.com/product.php? Product_no = 842, the product is really good! There are more than N free trial products on Xishi network. don't pay for free, what are you waiting for?] ~~
Link in
Help
------ Best solution --------------------
$ S = 'Jackie. cai free collar Ah http://www.ndjj.com/product.php? Product_no = 842, the product is really good! There are more than N free trial products on Xishi network. don't pay for free, what are you waiting for?] ~~ ';
Echo preg_replace ('/https? : \/Www \. [\ w-.] + \/[\ w .-? & #] +/Is ', '', $ s );
------ Other solutions --------------------
Oh, let's change it to a few situations:
Echo preg_replace ('/https? : \/Www \. [\ w-.] + \/[\ w .-? & # =\/] +/Is ', '', $ s );
------ Other solutions --------------------
Thank you!
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.