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?
since PHP 5.4 you can use http_response_code() for get and set header status code.
http_response_code()
here an example:
here is the document of this function in php.net:
http_response_code