简体   繁体   中英

How can I find and replace all URL's using regular expressions in PHP?

My URL's might not be well formatted, so it could be http://www.google.com/ or www.google.com or google.com and it'll be in a block of text like:

This is google.com and it rocks!

I need to find the website and replace it with [*********]

Any ideas?

看一下这个问题:正则表达式以匹配URL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM