$url = $_POST['url'];
$head = popen("ping $url",'r');
while(!feof($head))
{
$read = fread($head,4096);
$info.=$read;
}
然后对$info进行分析
一个判断句不用我写吧
$url = 'http://192.168.1.1/index.html';
if(fopen($url))
{
echo "It works!";
}else
{
echo "Can not connect!!";
}
?>
、
貌似一样的道理