This method will return the acceptable values with their quality scores and the corresponding parameters
as specified in the given Accept header. The array keys of the return value are the acceptable values,
while the array values consisting of the corresponding quality scores and parameters. The acceptable
values with the highest quality scores will be returned first. For example,
php
$header = 'text/plain; q=0.5, application/json; version=1.0, application/xml; version=2.0;';
$accepts = $request->parseAcceptHeader($header);
print_r($accepts);
displays:
[
'application/json' => ['q' => 1, 'version' => '1.0'],
'application/xml' => ['q' => 1, 'version' => '2.0'],
'text/plain' => ['q' => 0.5],
]
public parseAcceptHeader ( string $header ) : array | ||
$header | string | the header to be parsed |
Результат | array | the acceptable values ordered by their quality score. The values with the highest scores will be returned first. |