zozlak / http-accept
Set of methods to deal with the HTTP Accept header
Installs: 5 037
Dependents: 3
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
This package is auto-updated.
Last update: 2024-10-29 06:18:27 UTC
README
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`