initialize
[mdref/mdref-http] / http / Env / negotiate.md
1 # static string http\Env::negotiate(string $params, array $supported[, string $prim_typ_sep[, array &$result]])
2
3 Generic negotiator. For specific client negotiation see http\Env::negotiateContentType() and related methods.
4
5 > ***NOTE:*** The first elemement of $supported serves as a default if no operand matches.
6
7 ## Params:
8
9 * ```string $params```
10 HTTP header parameter's value to negotiate.
11 * ```array $supported```
12 List of supported negotiation operands.
13 * Optional ```string $prim_typ_sep```
14 A "primary type separator", i.e. that would be a hyphen for content language negotiation (en-US, de-DE, etc.).
15 * Optional reference ```array &$result```
16 Out parameter recording negotiation results.
17
18 ## Returns:
19
20 * ```NULL```, if negotiation fails.
21 * ```string```, the closest match negotiated, or the default (first entry of $supported).