php - Linking URL in middle of string -


wondering how detect url in string , return link. example

$text = 'go www.example.com example.com example.net http://example.com'; echo $text;

would return

go www.example.com example.com etc.

you use regex, or explode $text string on spaces , check substring each exploded word if begin http://, https:// or end in .com, .net, .org , wrap string in link


Comments

Popular posts from this blog

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -