I need to build a function which parses the domain from a URL.
So, with
http://google.com/dhasjkdas/sadsdds/sdda/sdads.html
or
You can pass PHP_URL_HOST into parse_url function as second parameter
$url = 'http://google.com/dhasjkdas/sadsdds/sdda/sdads.html'; $host = parse_url($url, PHP_URL_HOST); print $host; // prints 'google.com'