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