Con var_dump($_SERVER) vedi l'array $_SERVER e da li usi quello che ti serve. Al massimo spezzi/unsici cio' che vuoi.