<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.libxml.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.libxml-set-streams-context.php',
    1 => 'libxml_set_streams_context',
    2 => 'Set the streams context for the next libxml document load or write',
  ),
  'up' => 
  array (
    0 => 'ref.libxml.php',
    1 => 'libxml Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.libxml-set-external-entity-loader.php',
    1 => 'libxml_set_external_entity_loader',
  ),
  'next' => 
  array (
    0 => 'function.libxml-use-internal-errors.php',
    1 => 'libxml_use_internal_errors',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/libxml/functions/libxml-set-streams-context.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.libxml-set-streams-context" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">libxml_set_streams_context</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">libxml_set_streams_context</span> &mdash; <span class="dc-title">
   Set the streams context for the next libxml document load or write
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.libxml-set-streams-context-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>libxml_set_streams_context</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$context</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
   Sets the streams context for the next libxml document load or write.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.libxml-set-streams-context-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">context</code></dt>
      <dd>
       <p class="para">
        The stream context resource (created with
        <span class="function"><a href="function.stream-context-create.php" class="function">stream_context_create()</a></span>)
       </p>
      </dd>
     
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.libxml-set-streams-context-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Es wird kein Wert zurückgegeben.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.libxml-set-streams-context-errors">
  <h3 class="title">Fehler/Exceptions</h3>
  <p class="simpara">
   Throws a <span class="classname"><a href="class.typeerror.php" class="classname">TypeError</a></span> when a non-stream resource is
   passed to <code class="parameter">context</code>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.libxml-set-streams-context-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.4.0</td>
      <td>
       <span class="function"><strong>libxml_set_streams_context()</strong></span> now throws a
       <span class="exceptionname"><a href="class.typeerror.php" class="exceptionname">TypeError</a></span> when a non-stream resource is passed
       to <code class="parameter">context</code>, instead of throwing later when the
       context is used.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.libxml-set-streams-context-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 A <span class="function"><strong>libxml_set_streams_context()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="annotation-non-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$opts </span><span style="color: #007700">= [<br />    </span><span style="color: #DD0000">'http' </span><span style="color: #007700">=&gt; [<br />        </span><span style="color: #DD0000">'user_agent' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'PHP libxml agent'</span><span style="color: #007700">,<br />    ]<br />];<br /><br /></span><span style="color: #0000BB">$context </span><span style="color: #007700">= </span><span style="color: #0000BB">stream_context_create</span><span style="color: #007700">(</span><span style="color: #0000BB">$opts</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">libxml_set_streams_context</span><span style="color: #007700">(</span><span style="color: #0000BB">$context</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// request a file through HTTP<br /></span><span style="color: #0000BB">$dom </span><span style="color: #007700">= new </span><span style="color: #0000BB">DOMDocument</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$doc </span><span style="color: #007700">= </span><span style="color: #0000BB">$dom</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://www.example.com/file.xml'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.libxml-set-streams-context-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.stream-context-create.php" class="function" rel="rdfs-seeAlso">stream_context_create()</a> - Creates a stream context</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>