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 = parse_url($url, PHP_URL_HOST); echo implode('.', array_slice(explode('.', $domain), -2, 2))