Convert plain text url’s to clickable links

Just copy this function and make your links clickable

function plain_url_to_link($string) {
    return preg_replace(
    '%(https?|ftp)://([-A-Z0-9./_*?&;=#]+)%i',
    '<a target="blank" rel="nofollow" href="$0" target="_blank">$0</a>', $string);
}
$str = "https://www.google.com is a search website, you can also visit yahoo.com and http://twitter.com";
echo plain_url_to_link($str);