This PHP class allows you to leverage Check-Host.net's features for (HTTP | UDP | TCP | DNS | Ping) checks.
You can check the Ping of a domain using the following code:
$checkHost = new CheckHost();
echo $checkHost->checkPing('https://domain.com', 0, null);
- Domain: The domain you want to check.
- Max Nodes: Use
0
for all nodes. - Nodes: Use
null
for default nodes, or specify your own.
After getting the request_id
, you can retrieve the results using:
echo $checkHost->CheckResult("1607f590k2a9");
You can use similar methods for TCP, HTTP, DNS, and UDP checks:
- TCP:
checkTCP($hostname, $maxNodes, $nodes)
- HTTP:
checkHTTP($hostname, $maxNodes, $nodes)
- DNS:
checkDNS($hostname, $maxNodes, $nodes)
- UDP:
checkUDP($hostname, $maxNodes, $nodes)
You can fetch the node details with the following methods:
echo $checkHost->NodesHosts(); // List of nodes
echo $checkHost->NodesIPs(); // List of node IPs
- Clone this repository.
- Include the PHP class in your project.
- Use the methods as described above for the different types of checks.
This project is licensed under the MIT License.
Enjoy using this class to interact with Check-Host.net's powerful network tools! π