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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:36:23
Original
1206 people have browsed it

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

回复内容:

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

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

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

这个不知道对不对。

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

Related labels:
php
source:php.cn
Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template