0

Questions regarding the get_headers() php function:

  1. The function presents the headers in an array - is there any set order as to which header goes first?
  2. I noticed that the HTTP status code sent by the page goes first - is that always a given?
Spencer H
  • 653
  • 3
  • 12
  • 30
Mirian
  • 9
  • 7

1 Answers1

1

Yes. That's a given.

It reads the http headers from top top bottom, and a response always starts with the status line.

The first line of a Response message is the Status-Line, consisting of the protocol version followed by a numeric status code and its associated textual phrase...

You can read more about HTTP responses here: https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html

M. Eriksson
  • 13,450
  • 4
  • 29
  • 40