Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 61 | All time: 10,476 This week: 673 |
Version | License | PHP version | Categories | |||
http-status-class 1.0 | Shareware | 5 | HTTP, PHP 5 |
Description | Author | |||||||||||||||||||||||
This package can return HTTP status codes and their descriptions. |
|
Enums of all official http status codes and their descriptions.
composer require ahmard/http-status-codes
<?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 (6) |
File | Role | Description | ||
---|---|---|---|---|
src (3 files) | ||||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Read me |
Files (6) | / | src |
File | Role | Description |
---|---|---|
Description.php | Class | Class source |
StatusCode.php | Aux. | Auxiliary script |
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 |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.