Author Topic: Catchable fatal error: Object of class Net_Ping_Result could not be converted to  (Read 5460 times)

omi

  • Newbie
  • *
  • Posts: 13
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..

Code: [Select]
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 ..
Code: [Select]
Catchable fatal error: Object of class Net_Ping_Result could not be converted to

 

X

Do you know?

Just make posts in this community and win .com / .org / .net domain name free.
Know more..
Join Now!