need you help here.. I want to turn this : into : i have manage it by using this regex : preg_replace("#((http|https|ftp)://(\S*?\.\S*?))(\s|\;|\)|\]|\[|\{|\}|,|\"|'|:|\<|$|\.\s)#ie", "'<a href=\"$1\" target=\"_blank\">$1</a>$4'", $text); PHP: the problem is its not just replacing the text-url but also replace the the image-url, example into : need your help please
thanks for the reply, but its still does work. i have fixed using this function: function livelinked ($text){ preg_match_all("#((http|https|ftp)://(\S*?\.\S*?))(\s|\;|\)|\]|\[|\{|\}|,|\"|'|:|\<|$|\.\s)|^(jpg)#ie", $text, $ccs); foreach ($ccs[3] as $cc) { if (strpos($cc,"jpg")==false && strpos($cc,"gif")==false && strpos($cc,"png")==false ) { $old[] = "http://".$cc; $new[] = '<a href="http://'.$cc.'" target="_blank">'.$cc.'</a>'; } } return str_replace($old,$new,$text); } PHP: