extract domain or domain with subdomain from a link?
<p>i need a php function to extract domain with tld from a url or domain with tld and subdomain if there is.</p>

<p>example:</p>

<p><a href="http://minova.tumblr.com/post/145515" rel="nofollow">http://minova.tumblr.com/post/145515</a>   >>  minova.tumblr.com</p>

<p><a href="http://www.tumblr.com/about/1" rel="nofollow">http://www.tumblr.com/about/1</a> >> tumblr.com</p>

<p>Thanks</p>
