function strip_out_subdomain($domain) { $only_my_domain = preg_replace("/^(.*?)\.(.*)$/","$2",$domain); return $only_my_domain; } $domain = str_replace("www.",'',$_SERVER['SERVER_NAME']); #$domain = strip_out_subdomain($_SERVER['SERVER_NAME']); ?>