当我用exec('vnstat -tr', $results);
执行php脚本时
输出:
Array ( [0] => Sampling eth0 (5 seconds average)... 0 packets sampled in 5 seconds
[1] => Traffic average for eth0
[2] =>
[3] => rx 0.00 kbit/s 0 packets/s
[4] => tx
0.00 kbit/s 0 packets/s
[5] => )
当我在控制台中执行vnstat -tr时。 输出看起来像这样:
root@s2:~# vnstat -tr 313727 packets sampled in 5 seconds Traffic average for eth0
rx 10,42 Mbit/s 20092 packets/s
tx 488,22 Mbit/s 42653 packets/s
有人可以告诉我为什么PHP会返回错误的数据吗?