title: Execute ping command in php and get interactive output on webpage
body: <p>I tried to run ping command using php:</p>
  
  <pre><code>&lt;?php
      $response = shell_exec('ping -c 4 '. $_POST['host']);
      echo "&lt;div class=\"response\"&gt;".$response."&lt;/div&gt;";
  ?&gt;
  </code></pre>
  
  <p>But I post hostname from input box and then run this php script. This works but show output only when command run successfully not interactive as</p>
  
  <p><a href="https://w3dt.net/tools/ping" rel="nofollow">https://w3dt.net/tools/ping</a></p>
  
  <p>When I give "www.google.com" it shows the results in interactive manners. Can you please help me to build interactive as <strong>w3dt.net</strong> or suggest me any other way to achieve this.</p>