title: Grab results from a php exec() while the command is still running?
body: <p>When I run an <code>exec</code> from PHP like so:</p>
  
  <pre><code>$result = exec('command');
  </code></pre>
  
  <p>The results from this will be stored in <code>$result</code>. But in my current case, my command can take a few minutes and outputs results as it is running. Is there a way I can get output while it is running? I know that the <code>passthru</code> method will output the results to be browser, but I actually want it directly.</p>