As of php pinging the ip and output statistics?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
5 views
functions like system(); exec(); passthru(); return only one row, for example:
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
and that's all. What am I doing wrong? as you look at the statistics?
by | 5 views

3 Answers

0 like 0 dislike
exec("ping ya.ru", $out);
$out is an array of strings with the results
by
0 like 0 dislike
exec ("ping ya.ru",$cmd);
$row= count ($cmd);
$res="";
for ($i=0; $i<=$row; $i++)
{
$res = $res. "\". $cmd[$i];
};
by
0 like 0 dislike
thanks for the replies, the problem was in the-i option... not deduced if the interval was less than 0.2 sec.
by
110,608 questions
257,186 answers
0 comments
27,880 users