note 90969 deleted from function.stream-context-create by danbrown
| From: | danbrown@php.net | Date: | Tue, 19 May 2009 02:37:24 +0000 |
| Subject: | note 90969 deleted from function.stream-context-create by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155709@lists.php.net to get a copy of this message | ||
Note Submitter: grahamcrackers72 at yahoo dot com
----
@ Brian Gottier
You've got a couple typos in your code. This should work for an example of using an array for a
header option in the stream context options:
<?php
$opts = array(
'http'=> array(
'method'=> "GET",
'header'=> array( "Cookie: foo=bar" ),
'user_agent'=> $_SERVER['HTTP_USER_AGENT']
)
);
?>
From my experience, I have only had to do this when php is compiled --with-curlwrappers, but I guess
there may be other possibilities.