title: Stream context in PHP - what is it?
body: <p>I have searched for hours and I cannot figure out what a 'stream context' in PHP is. I'm trying to use an API and it involves using this 'stream context'.</p>
  
  <p>The documentation says:</p>
  
  <blockquote>
    <p>A context is a set of parameters and wrapper specific options which modify or enhance the behavior of a stream.</p>
  </blockquote>
  
  <ol>
  <li>A parameter of what?</li>
  <li>What is meant by an option being 'specific to a wrapper'?</li>
  <li>What stream?</li>
  </ol>
  
  <p>Here is the code I'm talking about:</p>
  
  <pre><code>// Encode the credentials and create the stream context.
  $auth = base64_encode("$acctKey:$acctKey");
  $data = array(
  'http' =&gt; array(
  'request_fulluri' =&gt; true,
  // ignore_errors can help debug – remove for production. This option added in PHP 5.2.10
  'ignore_errors' =&gt; true,
  'header' =&gt; "Authorization: Basic $auth")
  );
  $context = stream_context_create($data);
  // Get the response from Bing.
  $response = file_get_contents($requestUri, 0, $context);
  </code></pre>