Possible Duplicate:
How do I auto convert an url into a hyper link in PHP?
Let's say, I have an textfield on my website, where the user can enter anything he wants to. If the user enters a url, I would like to add code to this url in the background. Therefor I would need logic in order to recognize the url.
Example The user enters a text:
Please visit me at my website: http://www.mywebsite.org
I would like to change the code in the background to something like this:
Please visit me at my website: <a href="http://www.companywebsite.com/redirect.php?http://www.mywebsite.org">http://www.mywebsite.org</a>
How is it possible to change that link after the text has been submitted?