PHP: How to send HTTP response code?

后端 未结 9 1976
无人共我
无人共我 2020-11-22 06:05

I have a PHP script that needs to make responses with HTTP response codes (status-codes), like HTTP 200 OK, or some 4XX or 5XX code.

How can I do this in PHP?

9条回答
  •  Happy的楠姐
    2020-11-22 06:10

    With the header function. There is an example in the section on the first parameter it takes.

提交回复
热议问题