No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher une fonction PHP

stream_context_create

(PHP 4 >= 4.3.0, PHP 5, PHP 7)

stream_context_createCreates a stream context

Description

stream_context_create ([ array $options [, array $params ]] ) : resource

Creates and returns a stream context with any options supplied in options preset.

PHP: stream_context_create - Manual Home of Manuel PHP  Contents Haut

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.

PHP: stream_context_create - Manual Home of Manuel PHP  Contents Haut

Changelog

Version Description
5.3.0 Added the optional params argument.

PHP: stream_context_create - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 Using stream_context_create()

<?php
$opts 
= array(
  
'http'=>array(
    
'method'=>"GET",
    
'header'=>"Accept-language: en\r\n" .
              
"Cookie: foo=bar\r\n"
  
)
);

$context stream_context_create($opts);

/* Sends an http request to www.example.com
   with additional headers shown above */
$fp fopen('http://www.example.com''r'false$context);
fpassthru($fp);
fclose($fp);
?>

PHP: stream_context_create - Manual Home of Manuel PHP  Contents Haut

See Also

Find a PHP function
Error Infobrol

Can not display this page of the Infobrol website

Type of error (18-01)

Unknown format specifier "&"

Please try again in a few minutes…

Return to the home page




Steph