Registry / utility / willdurand-negotiation

willdurand-negotiation

JSON →
library3.1.0phppackagistunverified

Content Negotiation tools for PHP provided as a standalone library.

composer require willdurand/negotiation
INSTALL
IMPORT
SIG · WILLDURAND-NEGOTIA
W
willdurand-negotiation
utilityphpv3.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Negotiator
use Negotiation\Negotiator;

Negotiate the best media type from an Accept header.

use Negotiation\Negotiator; $negotiator = new Negotiator(); $mediaType = $negotiator->getBest('text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', ['text/html', 'application/json']); echo $mediaType->getValue(); // text/html
Debug
Known issues

No known issues recorded.

Upgrade
Version history
3.1.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Resources
willdurand-negotiation — pip install willdurand-negotiation · libregistry