get domain name from url bar php code example Example: php get domain name from url parse_url('http://www.website.com/hey.php', PHP_URL_HOST);