Parsing Domain From URL In PHP
<p>I need to build a function which parses the domain from a URL.</p>

<p>So, with <code>http://google.com/dhasjkdas/sadsdds/sdda/sdads.html</code> or <code>http://www.google.com/dhasjkdas/sadsdds/sdda/sdads.html</code>, it should return <code>google.com</code>; with <code>http://google.co.uk/dhasjkdas/sadsdds/sdda/sdads.html</code>, it should return <code>google.co.uk</code>.</p>
