Looking to make a string that starts with either http:// or www clickable.
str_replace("http://", "$string", "<a href='$string'>");
str_replace("www", "$string", "<a href='$string'>");
shouldnt it be something like that?
php
Looking to make a string that starts with either http:// or www clickable.
str_replace("http://", "$string", "<a href='$string'>");
str_replace("www", "$string", "<a href='$string'>");
shouldnt it be something like that?
Best Solution
Are you looking for something like this?
Update Thanks to macbirdie for pointing out the problem! I tried to fix it. However it only works as long as there is a space before the www. Maybe someone will come up with something more clever and elegant.