Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

stream_context_set_options

Description

The stream_context_set_options of Stream for PHP sets options on the specified context.

Syntax

stream_context_set_options(
    resource $stream_or_context,
    array $options
): bool

Parameters

stream_or_context

The stream or context resource to apply the options to.

options

The options to set for stream_or_context.

NOTE: Options must be an associative array of associative arrays in the format $array['wrapper']['option'] = $value.

Return

Returns true on success or false on failure.

Examples

1 · stream_or_context options

<?

$stream_or_context = stream_context_create();
$options = ["http" => ["method" => "POST"]];

$return = stream_context_set_options($stream_or_context, $options);

var_export($return);

?>
true
HomeMenu