MacMac
MacMac

Reputation: 35341

Link to text PHP

I'm already using this which I found on the net, for whenever I want to edit the information and there is already a converted link which is done by adding a new post, I need this to remove the link into text then when it's submitted to be updated, it will use this function to convert it into a link.

function Links($text)
{
     $text = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $text); 
     return $text;
} 

Thanks :)

Upvotes: 0

Views: 151

Answers (1)

kevinverhoef
kevinverhoef

Reputation: 64

Use strip_tags strip_tags("test");

Upvotes: 1

Related Questions