I am trying to ping domains / ips through php and I am using pear. I am using NET/Ping pear class. Now when I try to execute following code..
require_once "Net/Ping.php";
$ping = Net_Ping::factory();
if(PEAR::isError($ping)) {
$name = $ping->getMessage();
}
else
{
/* Number of packets to send */
$ping->setArgs(array('count' => 4));
$rawData=$ping->ping('18.23.32.2');
$name = "<pre>" . $rawData . "</pre>";
}
I want to then later give outfrom $name as array but I am facing the error ..
Catchable fatal error: Object of class Net_Ping_Result could not be converted to