Home >Backend Development >PHP Tutorial >用php实现ping百度,该怎么写?

用php实现ping百度,该怎么写?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 20:36:231201browse

用php实现ping百度,该怎么写?

回复内容:

用php实现ping百度,该怎么写?

=_=! 最好的实现方式应该是 exec("ping baidu.com") 吧...
当然如果你用 cURL 只抓取 HEAD 来判断的话也是可以的,但是基本原来上和 ping 应该是有差别的。

<code><?php system('ping -c1 -w1 193.33.186.70') ;
?>
</code>

这个不知道对不对。

我不知道楼主所说的ping 是 直接的ping 还是增加百度收录那个ping
exec("ping baidu.com") 直接ping
http://www.oschina.net/code/snippet_251355_21299 百度收录那个ping

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn