<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Stream Contexts</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="stream.filters.html">Stream Filters</a></div> <div class="next" style="text-align: right; float: right;"><a href="stream.errors.html">Stream Errors</a></div> <div class="up"><a href="book.stream.html">Streams</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="stream.contexts" class="chapter"> <h1>Stream Contexts</h1> <p class="simpara"> A <em>context</em> is a set of <em>parameters</em> and wrapper specific <em>options</em> which modify or enhance the behavior of a stream. <em>Contexts</em> are created using <span class="function"><a href="function.stream-context-create.html" class="function">stream_context_create()</a></span> and can be passed to most filesystem related stream creation functions (i.e. <span class="function"><a href="function.fopen.html" class="function">fopen()</a></span>, <span class="function"><a href="function.file.html" class="function">file()</a></span>, <span class="function"><a href="function.file-get-contents.html" class="function">file_get_contents()</a></span>, etc...). </p> <p class="simpara"> <em>Options</em> can be specified when calling <span class="function"><a href="function.stream-context-create.html" class="function">stream_context_create()</a></span>, or later using <span class="function"><a href="function.stream-context-set-option.html" class="function">stream_context_set_option()</a></span>. A list of wrapper specific <em>options</em> can be found in the <a href="context.html" class="xref">Context options and parameters</a> chapter. </p> <p class="simpara"> <em>Parameters</em> can be specified for <em>contexts</em> using the <span class="function"><a href="function.stream-context-set-params.html" class="function">stream_context_set_params()</a></span> function. </p> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="stream.filters.html">Stream Filters</a></div> <div class="next" style="text-align: right; float: right;"><a href="stream.errors.html">Stream Errors</a></div> <div class="up"><a href="book.stream.html">Streams</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>