zozlak/http-accept

Set of methods to deal with the HTTP Accept header

0.1.0 2019-07-30 10:05 UTC

This package is auto-updated.

Last update: 2024-01-29 04:19:07 UTC


README

Latest Stable Version Build Status Coverage Status License

HttpAccept

A static class making it easier to deal with the HTTP Accept header.

installation

composer require zozlak/http-accept

usage

$bestMatch = zozlak\HttpAccept::getBestMatch(['application/json', 'application/xml']);
echo (string) $bestMatch . "\n";
// e.g. for an Accept header of
//   text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
// you will get `application/xml;q=0.9`