Replace hyperlink to text in the string using php
by Jayanthi[ Edit ] 2014-01-11 12:10:47
Replace hyperlink to text
function replace_links($text)
{
$search = '/< a s[^>]*href=['"]([^'"]+)['"][^>]*>([^<]+)< /a >/i';
$replace = '2 ';
return(preg_replace($search, $replace, $text));
}