Chrome Extension

Set HTTP response code in php

    $status_code = 201;

If you want to set response status code header in PHP, you can do that using http_response_code($status_code) function. This will return the status code from the HTTP request.

You can get information about status codes from below link

HTTP response codes

Was this helpful?
Never leave your website again in search of code snippets by installing our chrome extension.