replace any url's within a string of text, to clickable links with php
php, regex
Solution
You can use regexp to do this:
$html_links = preg_replace('"\b(https?://\S+)"', '<a href="$1">$1</a>', $text);
Problem
Say i have a string of text such as ``` $text = "Hello world, be sure to visit http://whatever.com today"; ``` how can i (probably using regex) insert the anchor tags for the link (showing the link itself as the link text) ?