clean the url in php
<p>I am trying to make a user submit link box.  I've been trying all day and can't seem to get it working.</p>

<p>The goal is to make all of these into example.com... (ie. remove all stuff before the top level domain)</p>

<p>Input is <code>$url =</code> </p>

<p>Their are 4 types of url:</p>

<pre><code>www.example.com...
example.com...
http://www.example.com...
http://example.com...
</code></pre>

<p>Everything I make works on 1 or 2 types, but not all 4.  </p>

<p>How one can do this?</p>
