Page MenuHomeDevCentral

WithAcceptedLanguages.php
No OneTemporary

WithAcceptedLanguages.php

<?php
declare(strict_types=1);
namespace Keruald\OmniTools\HTTP\Requests;
trait WithAcceptedLanguages {
/**
* Gets the languages accepted by the browser, by order of priority.
*
* This will read the HTTP_ACCEPT_LANGUAGE variable sent by the browser in the
* HTTP request.
*
* @return string[] each item a language accepted by browser
*/
public static function getAcceptedLanguages () : array {
return AcceptedLanguages::fromServer()->getLanguageCodes();
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Feb 28, 20:14 (15 h, 25 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2436896
Default Alt Text
WithAcceptedLanguages.php (519 B)

Event Timeline