PHP Classes

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

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 61 All time: 10,476 This week: 673Up
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: 24 packages by
Country: Nigeria Nigeria
Age: ???
All time rank: 226511 in Nigeria Nigeria
Week rank: 178 Up7 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 (6)  
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 (6)  /  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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:61
This week:0
All time:10,476
This week:673Up