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

stream_context_set_option

Description

The stream_context_set_option of Stream for PHP sets an option for a stream/wrapper/context.

Syntax

stream_context_set_option(
    resource $stream_or_context,
    string $wrapper,
    string $option,
    mixed $value
): bool

Parameters

stream_or_context

The stream or context resource to apply the options to.

wrapper

The name of the wrapper (which may be different than the protocol).

option

The name of the option.

value

The value of the option.

Return

Returns true on success or false on failure.

Examples

1 · stream_or_context wrapper option value

<?

$stream_or_context = stream_context_create();
$wrapper = "http";
$option = "method";
$value = "POST";

$return = stream_context_set_option($stream_or_context, $wrapper, $option, $value);

var_export($return);
true