note 99353 added to function.stream-context-create
| From: | (at) | Date: | Thu, 12 Aug 2010 12:29:18 +0000 |
| Subject: | note 99353 added to function.stream-context-create | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-171600@lists.php.net to get a copy of this message | ||
I big NOTE that i hope will help some one. Something that is not mentioned in the documentation, is
that when php is compiled --with-curlwrappers,
So, instead of:
----------------------------------------------------------------
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: en\r\n" .
"Cookie: foo=bar\r\n"
)
);
$context = stream_context_create($opts);
----------------------------------------------------------------
You would setup the header this way:
----------------------------------------------------------------
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>array("Accept-language: en",
"Cookie: foo=bar",
"Custom-Header: value")
)
);
$context = stream_context_create($opts);
----------------------------------------------------------------
This will work.
----
Server IP: 69.147.83.197
Probable Submitter: 213.149.158.240
----
Manual Page -- http://www.php.net/manual/en/function.stream-context-create.php
Edit -- https://master.php.net/note/edit/99353
Del: integrated -- https://master.php.net/note/delete/99353/integrated
Del: useless -- https://master.php.net/note/delete/99353/useless
Del: bad code -- https://master.php.net/note/delete/99353/bad+code
Del: spam -- https://master.php.net/note/delete/99353/spam
Del: non-english -- https://master.php.net/note/delete/99353/non-english
Del: in docs -- https://master.php.net/note/delete/99353/in+docs
Del: other reasons-- https://master.php.net/note/delete/99353
Reject -- https://master.php.net/note/reject/99353
Search -- https://master.php.net/manage/user-notes.php