stream_context_set_params()

stream_context_set_params() — Set parameters for a stream/wrapper/context.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

Signature

stream_context_set_params(resource $context, array $params): true

Parameters

ParameterTypeWhat it takes
$contextresourceThe stream or context to apply the parameters too.
$paramsarrayAn associative array of parameters to be set in the following format: $params['paramname'] = "paramvalue";.

Return value

Returns true on success or false on failure.

Example

The PHP manual ships no example for stream_context_set_params(); the signature and the parameter table above are the contract.

All PHP 8.5 built-in functions

Reference card built from the PHP manual page stream_context_set_params() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.