PHP code example of tylercd100 / server-status
1. Go to this page and download the library: Download tylercd100/server-status 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/ */
tylercd100 / server-status example snippets
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