how to convert this ??
Posted: Mon Apr 09, 2007 6:46 am
Hello forums !!
suppose i had following string
I want to know:
1> how to convert the string: http://example.com is converted into a link .
ie when $string is displayed ie, a link should appear instead of plain text. ie <a href="http://$sitenamefromdb.com">http://$sitenamefromdb.com</a>
Note: if the $sitenamefromdb 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 !!
suppose i had following string
Code: Select all
$string = "hello friends . My site is http://$sitenamefromdb.com";1> how to convert the string: http://example.com is converted into a link .
ie when $string is displayed ie
Code: Select all
echo $string;Note: if the $sitenamefromdb 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 !!