<?php
use Symfony\Component\HttpFoundation\Request;
$request = Request::createFromGlobals();
// Returns the preferred language
$preferredLang = $request->getPreferredLanguage();
// Languages acceptable by the client browser
$languages = $request->getLanguages();
dump($preferredLang, $languages);
^ "en_US"
^ array:2 [
0 => "en_US"
1 => "en"
]