This is a simple library for creating http responses in bare bones php.
composer require withinboredom/response-code
<?php
require_once 'vendor/autoload.php';
use function Withinboredom\ResponseCode\http_response_code;
use Withinboredom\ResponseCode\HttpResponseCode;
http_response_code(HttpResponseCode::Accepted);
The response codes are based on RFC 9119 which took effect in June 2022.