$url = 'http;//www.google.com/blabla'; $host = parse_url($url, PHP_URL_HOST); echo $host; //