title: PHP - Check if server is offline and not show a warning in XAMPP
body: <p>i'm currently checking if a server(in this case 192.168.1.135) is online with this php code:</p>
  
  <pre><code>&lt;?php 
  $fp = fsockopen("192.168.1.135", 443, $errno, $errstr, 0.4); //(line 47)
  if (!$fp) {
    echo "OFFLINE";
  }
  else{
   echo "ONLINE";
  }
  ?&gt;
  </code></pre>
  
  <p>I have this code on my own server 192.168.1.130 using XAMPP (on LAN ofcourse)</p>
  
  <p>So, if this server is offline the output will be:</p>
  
  <pre><code>Warning: fsockopen(): in C:\xampp\htdocs\index.php on line 47
  OFFLINE
  </code></pre>
  
  <p>it should just be "OFFLINE". How to show just OFFLINE without the warning?</p>
  
  <p>I think XAMPP will send me the warning when the server is down. but how should I do to not show the warning? I don't find a setting for this in XAMPP, anyone know?</p>
  
  <p>if no, how should i do the line 47 correct even when the server is down(offline)?</p>
  
  <p>When the server is online, this will work perfecly. </p>