Are you looking for a regular expression to make clickable url in the string? Yes!, you will get your solutions here:
echo preg_replace("/http\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/", "$0", $string);
If you want to open url in new tab then :
echo preg_replace("/http\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/", "$0", $string);
Leave a Reply