var_dump($_SERVER); e vedi che parte ti torna utile
es.: $_SERVER['HTTP_HOST']