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

stream_context_create

Description

The stream_context_create of Stream for PHP creates a stream context.

Syntax

stream_context_create(
    ?array $options = null,
    ?array $params = null
): resource

Parameters

options

Must be an associative array of associative arrays in the format $arr['wrapper']['option'] = $value. Refer to context options for a list of available wrappers and options.

Default to an empty array.

params

Must be an associative array in the format $arr['parameter'] = $value. Refer to context parameters for a listing of standard stream parameters.

Return

Returns a stream context resource.

Examples

1 · void

<?

$return = stream_context_create();

echo $return;

?>
Resource id #2

2 · options

<?

$options =
[
    "http" =>
    [
        "method" => "POST"
    ]
];

$return = stream_context_create($options);

echo $return;

?>
Resource id #2

3 · params

<?

$options =
[
    "http" =>
    [
        "method" => "POST"
    ]
];
$params =
[
    "notification" => "stream_notification_callback"
];

$return = stream_context_create($options, $params);

echo $return;

?>
Resource id #2
HomeMenu