Skip to content

tylercd100/server-status

Repository files navigation

PHP Server Status

Latest Version Software License Build Status Scrutinizer Code Quality Code Coverage Dependency Status Total Downloads

Can ping and return status code of a host

Installation

Install via composer - In the terminal:

composer require tylercd100/server-status

Usage

use Tylercd100\ServerStatus\Host;

$host = new Host("google.com"); // or an IP address; 127.0.0.1

echo "Host ping: " . $host->ping() . "\n";
echo "Host status code: " . $host->status() . "\n";

# Host ping: 30.0
# Host status code: 200