reference/stream/functions/stream-context-create.xml
29cf1ea0ec2d4ee04f723da66461a2f613e0876f
...
...
@@ -85,13 +85,13 @@
85
85
<programlisting role="php">
86
86
<![CDATA[
87
87
<?php
88
-
$opts = array(
89
-
'http'=>array(
90
-
'method'=>"GET",
91
-
'header'=>"Accept-language: en\r\n" .
92
-
"Cookie: foo=bar\r\n"
93
-
)
94
-
);
88
+
$opts = [
89
+
'http' => [
90
+
'method' => "GET",
91
+
// Use newline \n to separate multiple headers
92
+
'header' => "Accept-language: en\nCookie: foo=bar",
93
+
]
94
+
];
95
95

96
96
$context = stream_context_create($opts);
97
97

98
98