title: How can i run php script with timer?
body: <p>I have foreach functions that print students names</p>
  
  <pre><code>$names = array("Alex","Brad","Tom");
  foreach($names as $name) {
     echo "$name &lt;br /&gt;";
     sleep(3);
  }
  </code></pre>
  
  <p>How can i print each name, each 3 seconds? 
  After <code>"echo $name"</code> i need some timer to stop the loop and wait for 3 seconds.
  <code>sleep()</code> functions doesn't work here. What else i can do?</p>