Jump to content

Url regex


Hrenojed

Recommended Posts

Hey,

 

I need to upgrade some website I made and I'm kinda out of PHP for a while. I need to make url like

[url=http://www.google.com]Search with Google![/url]

 

At the current website, I have regex for stuff like bold, italic, etc.

 

$c['text'] = preg_replace("#\[b\](.*?)\[\/b\]#is", "<b>$1</b>", $c['text']);

 

I need to have a regex for url that looks like the one up there for Google.

 

I've searched on google and here and I couldn't find anything like this.

 

Thanks!

Hrenojed

 

 

Link to comment
https://forums.phpfreaks.com/topic/71776-url-regex/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.