stream_context_create

Creates a stream context

Syntax

stream_context_create ([ array $options [, array $params ]] ) : 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

A stream context resource.

Examples

1 · void

<?

$return = stream_context_create();

echo $return;

?>
Resource id #2

2 · options

<?

$options = array("http" => array("method" => "POST"));

$return = stream_context_create($options);

echo $return;

?>
Resource id #2

3 · params

<?

$options = array("http" => array("method" => "POST"));
$params = array("notification" => "stream_notification_callback");

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

echo $return;

?>
Resource id #2
HomeMenu