PHP Class Inpsyde\MultilingualPress\Module\Redirect\LanguageNegotiation\AcceptLanguageParser

Since: 3.0.0
Inheritance: implements Inpsyde\MultilingualPress\Common\AcceptHeader\AcceptHeaderParser
Afficher le fichier Open project: inpsyde/multilingual-press

Méthodes publiques

Méthode Description
parse ( string $header ) : array Parses the given Accept header and returns the according data in array form.

Private Methods

Méthode Description
get_values ( string $header ) : string[] Returns the array with the individual values of the given Accept header.
normalize_priority ( string $priority ) : float Returns a normalized float value between 0 and 1 for the given numeric string.
remove_comment ( string $header ) : string Returns the given Accept header without comment.
split_value ( string $value ) : array Returns the array with the language and priority of the given value, and an empty array for an invalid language.

Method Details

parse() public méthode

Parses the given Accept header and returns the according data in array form.
Since: 3.0.0
public parse ( string $header ) : array
$header string Accept header string.
Résultat array Parsed Accept header in array form.