previousNet_Ping::Net_Ping() (Previous) (Next) Net_Ping::setArgs()next

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Net_Ping::ping()

Net_Ping::ping() – Exécute une commande Ping

Synopsis

require_once 'Net/Ping.php';

string Net_Ping::ping ( string host )

Description

Execute une commande Ping.

Parameter

  • string $host - Le nom du serveur ou une adresse IP

Return value

string - Le message retourné par la commande Ping.

Note

This function can not be called statically.

Example

Envoyer une requête Ping

<?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'));
}
?>
previousNet_Ping::Net_Ping() (Previous) (Next) Net_Ping::setArgs()next

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.