PHP Classes

PHP HTTP Status Code Constants Class: Return HTTP status codes and their descriptions

Recommend this page to a friend!
  Info   View files Documentation   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-05-06 (5 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 58 All time: 10,397 This week: 88Up
Version License PHP version Categories
http-status-class 1.0Shareware5HTTP, PHP 5
Description 

Author

This package can return HTTP status codes and their descriptions.

It defines constants that are associated with each HTTP status code.

The package can also return text descriptions for each supported HTTP status code.

Picture of Ahmad Mustapha
Name: Ahmad Mustapha <contact>
Classes: 23 packages by
Country: Nigeria Nigeria
Age: ???
All time rank: 232813 in Nigeria Nigeria
Week rank: 7 Up1 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 9x

Documentation

Http Status Codes

Enums of all official http status codes and their descriptions.

Installation

composer require ahmard/http-status-codes

Usage

<?php

require __DIR__ . '/vendor/autoload.php';


$sc = \HttpStatusCodes\StatusCode::CREATED;

// Get Status Code  =>  "201"
$sc->value;

$desc = $sc->describe();

// Get Status Code  =>  "201"
$desc->code;

// Get Status Code Title  => "Created"
$desc->title;

You can also get description of a given status code, the description is copied from Wikipedia.

<?php

$sc = \HttpStatusCodes\StatusCode::CREATED;

// Get Description  =>  "The request has been fulfilled, resulting in the creation of a new resource."
$sc->describe()->desc;


  Files folder image Files  
File Role Description
Files folder imagesrc (3 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Read me

  Files folder image Files  /  src  
File Role Description
  Plain text file Description.php Class Class source
  Accessible without login Plain text file StatusCode.php Aux. Auxiliary script
  Plain text file StatusDetail.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:58
This week:0
All time:10,397
This week:88Up