I need to build a function which parses the domain from a URL.
So, with
http://google.com/dhasjkdas/sadsdds/sdda/sdads.html
or
$domain = str_ireplace('www.', '', parse_url($url, PHP_URL_HOST));
This would return the google.com for both http://google.com/... and http://www.google.com/...
google.com