composer require weew/helpers-network
This tiny library provides various helper functions for network interaction.
Ping a host, returns latency if the host could be reached, otherwise returns false
. Note: works ony on Linux
and OS X
.
int|bool ping(string $host, [, int $timeout = 1 [, $ttl = 255]])