PING Curl PHP

  Umum
<?php
$url = '192.168.1.200:8082';
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_NOBODY, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_exec($ch);
    $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    if (200==$retcode) {
        // All's well
    echo "Server PD Dikti Hidup" ;
    } else {
   echo "Server Pd Dikti Mati" ;     // not so much
    }

?>

LEAVE A COMMENT