Jump to content

Reg Exp to replace hyperlinks


macgyver

Recommended Posts

Hi I'm after some help to convert web addresses in some text body to hyperlinks.

So a user may enter [a href=\"http://www.phpfreaks.com\" target=\"_blank\"]http://www.phpfreaks.com[/a] into a text area. When the text is then displayed I want to go through and convert these to hyperlinks. Ideally would do it if the user missed off the http:// and typed www.phpfreaks.com.

I guess I need a reg expression but I need pointing in the right direction

Cheers

Mac
Link to comment
https://forums.phpfreaks.com/topic/11849-reg-exp-to-replace-hyperlinks/
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.