PHP obtiene subdominio

$subdomain = explode('.', $_SERVER['HTTP_HOST'])[0];
portapipe