PHP dapatkan subdomain

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