当前位置:Gxlcms > PHP教程 > 怎么得到PING反回的的值

怎么得到PING反回的的值

时间:2021-07-01 10:21:17 帮助过:23人阅读

如何得到 PING 反回的的值
如何得到 PING 反回的的值

文件 1.txt 内容是PING内容
Pinging www.qq.com [14.17.32.211] with 32 bytes of data:
Reply from 14.17.32.211: bytes=32 time=20ms TTL=53
Reply from 14.17.32.211: bytes=32 time=13ms TTL=53
Reply from 14.17.32.211: bytes=32 time=13ms TTL=53
Reply from 14.17.32.211: bytes=32 time=13ms TTL=53
Reply from 14.17.32.211: bytes=32 time=13ms TTL=53
Reply from 14.17.32.211: bytes=32 time=13ms TTL=53
Reply from 14.17.32.211: bytes=32 time=13ms TTL=53
Reply from 14.17.32.211: bytes=32 time=12ms TTL=53
Reply from 14.17.32.211: bytes=32 time=13ms TTL=53
Reply from 14.17.32.211: bytes=32 time=12ms TTL=53
Ping statistics for 14.17.32.211:
Packets: Sent = 10, Received = 10, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 12ms, Maximum = 20ms, Average = 13ms

要用什么代码,得到 Pinging (*值)[*值] with 32 bytes of data: (想得到 www.qq.com和14.17.32.211 )
最后再得到
Sent =*值
Received =*值
Lost =*值
Minimum =*值
Maximum =*值
Average = *值 PING

分享到:


------解决方案--------------------
噢,漏了 IP
preg_match_all('/(Pinging 
------解决方案--------------------
for
------解决方案--------------------
(\w+) = )([\w.]+)/s', $s, $r);
print_r($r);

人气教程排行