Answer the question
In order to leave comments, you need to log in
How to ping ip from php and display statistics?
functions of type system(); exec(); passthru(); return only one string, for example:
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
and that's it. What am I doing wrong? how to see statistics?
Answer the question
In order to leave comments, you need to log in
exec("ping ya.ru", $out);
$out will contain an array of strings with the results
exec("ping ya.ru",$cmd);
$row=count($cmd);
$res="";
for ($i=0; $i<=$row; $i++)
{
$res = $res. "\n". $cmd[$i];
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question