PEAR Manual
Prev |  | Next

# Net_Ping::ping()

Net_Ping::ping() -- executes a ping command

## Synopsis

    require_once 'Net/Ping.php';

``string Net_Ping::ping` (string host)`

## Description

Executes a ping command

## Parameter

- `string $host` - the name of the server or the IP-adress

## Return value

`string` - the return message of the ping command

## Note

This function can not be called statically.

## Example

Example 48-1. Sending a ping request
    <?php

    require_once 'Net/Ping.php' ;

    $ping = new Net_Ping;
    $ping->setArgs(array("count" => 5,
                         "size"  => 32,
                         "ttl"   => 512
                        )
                  );
    var_dump($ping->ping("example.com"));

    ?>

Prev | Home | Next
Net_Ping::Net_Ping() | Up | Net_Ping::setArgs()