Hello Eoin Scolard
Please help me changed to code below and check it
$text = $fbevent["description"];
$reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
preg_match_all($reg_exUrl, $text, $matches);
$usedPatterns = array();
foreach($matches[0] as $pattern){
if(!array_key_exists($pattern, $usedPatterns)){
$usedPatterns[$pattern]=true;
$text = str_replace ($pattern, '<a href="'.$pattern.'" target="_blank">'.$pattern.'</a>', $text);
}
}
echo nl2br($text);
Best regards
Bach Pham