Location: PHPKode > scripts > Net ping > index.php
<?php
include 'netping.php';
$dest="google.com";
$src1="192.168.1.3";
$ping=new Net_Ping();
$ping->Ping($dest);
    if ($ping->time)
        echo "Time to $dest: " . $ping->time.PHP_EOL;
    else
        echo $ping->errstr;

$ping2=new Net_Ping();
$ping2->Ping($dest,$src1,5,10);
    if ($ping2->time)
        echo "Time from $src1 to $dest: " . $ping2->time.PHP_EOL;
    else
        echo $ping->errstr;
?>
Return current item: Net ping