title: How to take an PHP output and show it in an ul
body: <p>I have a simple php script for pinging a ip address but how do I take the output and display if it's online of offline in an unordered list in html</p>
  
  <pre><code>   &lt;?php
  
  
  function ping($host)
  {
          exec(sprintf('ping -c 1 -W 5 %s', escapeshellarg($host)), $res, $rval);
          return $rval === 0;
  }
  
  
  $host = 'www.example.com';
  $up = ping($host);
  ?&gt;
  </code></pre>