PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Maxim Ignatenko   Net Ping   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: example
Class: Net Ping
Send ping requests sending ICMP packets
Author: By
Last change:
Date: 14 years ago
Size: 424 bytes
 

Contents

Class file image Download
<?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;
?>