PHP code example of webignition / is-http-status-code

1. Go to this page and download the library: Download webignition/is-http-status-code library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webignition / is-http-status-code example snippets



$this->assertTrue(\webignition\IsHttpStatusCode\IsHttpStatusCode::check(100));
$this->assertTrue(\webignition\IsHttpStatusCode\IsHttpStatusCode::check(301));
$this->assertTrue(\webignition\IsHttpStatusCode\IsHttpStatusCode::check(404));
$this->assertTrue(\webignition\IsHttpStatusCode\IsHttpStatusCode::check(503));

$this->assertFalse(\webignition\IsHttpStatusCode\IsHttpStatusCode::check(true));
$this->assertFalse(\webignition\IsHttpStatusCode\IsHttpStatusCode::check(false));
$this->assertFalse(\webignition\IsHttpStatusCode\IsHttpStatusCode::check('Hello World!'));