Hello forums!
suppose i had following string
[PHP]$string = "hello friends . My site is http://example.com";[/PHP]
I want to know:
1> how to convert the string: [
$example.com...] is converted into a link .
ie when $string is displayed ie [PHP]echo $string;[/PHP], a link should appear instead of plain text. ie <a href="http://example.com.com">http://$example.com</a>
Note: if the $example.com was static i could solve using str_replace, since its dynamic as it comes from the db. i didnt get the idea..
i think we should search http:// or www. in a word of a string and replace that word...
Please help me..
Thanks in advance to all of you!
[edited by: dreamcatcher at 12:03 pm (utc) on April 9, 2007]
[edit reason] Use example.com, thanks. [/edit]