|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-08-23 05:42 UTC] aharvey@php.net
-Status: Open
+Status: Feedback
[2010-08-23 05:42 UTC] aharvey@php.net
[2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 01:00:02 2025 UTC |
Description: ------------ My PHP is 5.2.13,if use under code <?php // Create a stream $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "Cookie: foo=bar\r\n" ) ); $context = stream_context_create($opts); // Open the file using the HTTP headers set above $file = file_get_contents('http://www.example.com/', false, $context); ?> use Wireshark check HTTP request header is: User-Agent: PHP/5.2.13\r\n Host: en.wikipedia.org\r\n Accept: */*\r\n I set header not exists Test script: --------------- <?php // Create a stream $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "Cookie: foo=bar\r\n" ) ); Expected result: ---------------- User-Agent: PHP/5.2.13\r\n Host: en.wikipedia.org\r\n Accept-language: en\r\n Cookie: foo=bar\r\n Actual result: -------------- User-Agent: PHP/5.2.13\r\n Host: en.wikipedia.org\r\n Accept: */*\r\n