I need to build a function which parses the domain from a URL.
So, with
http://google.com/dhasjkdas/sadsdds/sdda/sdads.html
or
parse_url didn't work for me. It only returned the path. Switching to basics using php5.3+:
$url = str_replace('http://', '', strtolower( $s->website)); if (strpos($url, '/')) $url = strstr($url, '/', true);