Thanks Gvre for your reply.
I changed it to preg_match_all but it doesn't work as expected, the urls are not parsed properly.
Do you have any hints?
PHP Code:
$Note = "This is my note with a link: https://domain.com/application.php?i=VHubsKu2ly7EfHXVLhEe# and with another link http://domain.com";
$reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
$stripped = preg_match_all($reg_exUrl, $Note, $matches, PREG_SET_ORDER);
foreach ($matches as $val) {
$Note = preg_replace($reg_exUrl, '<a href="'.$val[0].'">link </a>', $Note);
}
echo "$Note";