string
Net_Ping::ping (
string
host
)
pingコマンドを実行します。
string $host
-
サーバーの名前かIPアドレスを指定します。
string
-
pingコマンドのメッセージを返します。
This function can not be called statically.
Sending a ping request
<?php
require_once "Net/Ping.php";
$ping = Net_Ping::factory();
if (PEAR::isError($ping)) {
echo $ping->getMessage();
} else {
$ping->setArgs(array('count' => 2));
var_dump($ping->ping('example.com'));
}
?>