How do you strip out the domain name from a URL in php (trying again)?
<p>Ive asked this question before, but I discovered a problem with the top answer. Its been suggested I use parse_url() to get the domain part of any URL. The problem is, the function wont work if the url doesn't start with http://</p>

<p>Are there any alternatives to using the parse_url function? The only I can see, is adding http:// to the url if its not there before feeding it into the function. </p>
