php get domain name without www php code example
Example 1: php get domain name from url
parse_url('http://www.website.com/hey.php', PHP_URL_HOST);
Example 2: php get domain name with https
echo $_SERVER['SERVER_NAME']; //Outputs www.example.com