title: Check if text contains URL
body: <p>How can I check if text in PHP contains a link in it's text?
  I have a database table format as follow.</p>
  
  <pre><code>+------------------+
  | id | posts | tag |
  +------------------+
  | 1  | text 1|  0  | //no links
  | 2  | text 2|  1  | //contains links
  </code></pre>
  
  <p>Basically, I want to verify that the submitted entry contains a link, if it does, 
  the <code>tag</code> column will have a value of <code>1</code>.</p>
  
  <p>Can someone help me to properly code the above sample? Currently this is my PHP:</p>
  
  <pre><code>include 'function.php';
  
  $text= $_POST['text'];
  
  //if $text contains a url then do this function 
  postEntryWithUrl($text);
  
  //else here 
  postEntry($text);
  </code></pre>