Ping a host and check if it's alive.
use Myerscode\Utilities\Web\PingUtility;
$utility = new PingUtility('https://example.com');Ping the host and return whether it's alive and the latency in milliseconds.
$result = $utility->ping();
// ['alive' => true, 'latency' => 12.0]Check if the host is alive.
$utility->isAlive(); // trueGet the latency in milliseconds, or null if unreachable.
$utility->latency(); // 12.0Set the ping timeout in seconds.
$utility->setTimeout(5)->ping();Set the TTL (time to live).
$utility->setTtl(128)->ping();Get the URL the utility is using.
$url = $utility->url();