title: HTML5/PHP: How to recognize a typed in url
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5531502/how-do-i-auto-convert-an-url-into-a-hyper-link-in-php">How do I auto convert an url into a hyper link in PHP?</a>  </p>
  </blockquote>
  
  
  
  <p>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.</p>
  
  <p>Example
  The user enters a text:</p>
  
  <pre><code>Please visit me at my website: http://www.mywebsite.org
  </code></pre>
  
  <p>I would like to change the code in the background to something like this:</p>
  
  <pre><code>Please visit me at my website: &lt;a href="http://www.companywebsite.com/redirect.php?http://www.mywebsite.org"&gt;http://www.mywebsite.org&lt;/a&gt;
  </code></pre>
  
  <p>How is it possible to change that link after the text has been submitted?</p>