arrayperu/http-code

PHP Library for HTTP Status codes.

v1.0.0 2021-09-24 19:35 UTC

This package is auto-updated.

Last update: 2024-10-25 04:10:26 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

PHP Library for HTTP Status codes.

Table of Contents

Installation

Composer

composer require arrayperu/http-code

Usage

use ArrayPeru\HttpCode;

echo HttpCode::HTTP_OK; // 200
echo HttpCode::text(HttpCode::HTTP_OK); // OK

echo HttpCode::HTTP_NOT_FOUND; // 404
echo HttpCode::text(HttpCode::HTTP_NOT_FOUND); // Not Found

echo HttpCode::HTTP_INTERNAL_SERVER_ERROR; // 500
echo HttpCode::text(HttpCode::HTTP_INTERNAL_SERVER_ERROR); // Internal Server Error

Table of reference

1xx - Informational

2xx - Successful

3xx - Redirect

4xx - Client Error

5xx - Server Error