title: URL parse function
body: <p>Given this variable:</p>
  
  <pre><code>$variable = foo.com/bar/foo
  </code></pre>
  
  <p>What function would trim $variable to foo.com ?  </p>
  
  <p>Edit: I would like the function to be able to trim anything on a URL that could possibly come after the domain name.  </p>
  
  <p>Thanks in advance,</p>
  
  <p>John</p>