1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-24 07:42:10 +01:00

fix(reference/stream): HTTP headers are U+0D U+0A (CR LF) separated

correction of the formally wrong comment and place in the example code.

streamlining the example code style on separating multiple headers over multiple lines.

compare Section 4.1 of RFC-2616 etc.

        generic-message = start-line
                          *(message-header CRLF)
                          CRLF
                          [ message-body ]

RFC-2616: https://www.rfc-editor.org/rfc/rfc2616#section-4.1
ok: /reference/stream/functions/stream-context-set-default.xml etc.
This commit is contained in:
hakre
2025-06-22 14:59:37 +02:00
committed by Hans Krentel (hakre)
parent 1d45574f4d
commit 037266adde

View File

@@ -88,8 +88,9 @@
$opts = [
'http' => [
'method' => "GET",
// Use newline \n to separate multiple headers
'header' => "Accept-language: en\nCookie: foo=bar",
// Use CRLF \r\n to separate multiple headers
'header' => "Accept-language: en\r\n" .
"Cookie: foo=bar",
]
];