Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2010-10-24 04:15
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;
?>