title: Creating a ping uptime service with PHP
body: <p>I have a server that I can use PHP on and a router that can be pinged from the Internet. I want to write a PHP script that sends a ping to the router every 5 minutes with the following results:</p>
  
  <ul>
  <li>If the ping succeeds, then nothing would happen.</li>
  <li>If the ping fails, then it waits a few minutes, and if it still fails it sends a warning to my e-mail address once.</li>
  <li>After the router is pingable again it sends an e-mail that it's OK.</li>
  </ul>
  
  <p>Could this be done with PHP? How? Does anybody has a <strong>small</strong> PHP file that does this?</p>