@ali.bayat
من می خوام از سرورم pingبگیرم تا زمانی که سرور قطع شد بفهمم .
چطوری با php  پینگ بگیرم
تست کنید ببینید این کدومیش جواب میده واستون!
function urlExists($url=NULL)  
{  
    if($url == NULL) return false;  
    $ch = curl_init($url);  
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);  
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);  
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  
    $data = curl_exec($ch);  
    $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);  
    curl_close($ch);  
    if($httpcode>=200 && $httpcode<300){  
        return true;  
    } else {  
        return false;  
    }  
} function pingAddress($ip) {
    $pingresult = exec("/bin/ping -n 3 $ip", $outcome, $status);
    if (0 == $status) {
        $status = "alive";
    } else {
        $status = "dead";
    }
    echo "The IP address, $ip, is  ".$status;
}$host = '193.33.186.70';
$port = 80;
$waitTimeoutInSeconds = 1;
if ($fp = fsockopen($host,$port,$errCode,$errStr,$waitTimeoutInSeconds)) {
  // It worked
} else {
  // It didn't work
}
fclose($fp);آیا مایل به ارسال نوتیفیکیشن و اخبار از طرف راکت هستید ؟