<?php
function check_server_status($host, $port, $timeout) {
  $start_time = microtime(TRUE);
  $status = fsockopen($host, $port, $errno, $errstr, $timeout);
  if (!$status) {
    return "Server is down.";
  }

  $end_time = microtime(TRUE);
  $time_taken = $end_time - $start_time;
  $time_taken = round($time_taken,5);

  return "Server responded in " . $time_taken * 1000 . " ms.";
}
echo check_server_status('api-taw.pixelbeard.co', 80, 12);
echo check_server_status('70.32.96.19', 8999, 12);
?>
<!-- <form action="" method="post">
Domain name: <input type="text" name="domain" value="api-taw.pixelbeard.co" />
<input type="submit" value="Submit" />
</form>

<strong>
<?php if($_POST['domain']) echo "Status: " . check_server_status($_POST['domain'], 80, 12); ?>
</strong> -->

<p>HTTPS: <?php echo $_SERVER['HTTPS']; ?></p>
<p>HTTPS: <pre><?php var_dump($_SERVER); ?></pre></p>
<?php echo phpinfo(); ?>