mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-31 05:12:16 +02:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@166185 c90b9560-bf6c-de11-be94-00142212c4b1
79 lines
2.2 KiB
XML
79 lines
2.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.9 $ -->
|
|
<!-- EN-Revision: 1.4 Maintainer: didou Status: ready -->
|
|
<refentry id="function.stream-context-create">
|
|
<refnamediv>
|
|
<refname>stream_context_create</refname>
|
|
<refpurpose>Crée un contexte de flux</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>resource</type><methodname>stream_context_create</methodname>
|
|
<methodparam choice="opt"><type>array</type><parameter>options</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
<methodname>stream_context_create</methodname> crée et retourne un contexte
|
|
de flux, avec les paramètres fournis par <parameter>options</parameter>.
|
|
</simpara>
|
|
<simpara>
|
|
Le paramètre <parameter>options</parameter> doit être un tableau
|
|
associatif, au format <literal>$arr['wrapper']['option'] = $value</literal>.
|
|
Par défaut, c'est un tableau vide.
|
|
</simpara>
|
|
<example>
|
|
<title>Exemple avec <function>stream_context_create</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$opts = array (
|
|
'http'=>array (
|
|
'method' => 'GET',
|
|
'header' => "Accept-language: en\r\n" .
|
|
"Cookie: foo=bar\r\n"
|
|
)
|
|
);
|
|
|
|
$context = stream_context_create($opts);
|
|
|
|
// Envoie une requête HTTP à www.example.com
|
|
// avec des en-têtes supplémentaires
|
|
$fp = fopen('http://www.example.com', 'r', false, $context);
|
|
fpassthru($fp);
|
|
fclose($fp);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<simpara>
|
|
Voir aussi
|
|
<function>stream_context_set_params</function> et
|
|
la liste des gestionnaires avec des options de contexte
|
|
(<xref linkend="wrappers"/>).
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|