2

Trying to display my results progressively, as it would be displayed in CMD. (ie: line by line)

Not even sure where to start?

    <?php
$ip = "8.8.8.8";

exec("tracert -d ".$ip." && exit", $output);

    foreach($output as $out){
    echo $out;
    echo '<br>';
    }

?>

Any assistance would be appreciated

Dan
  • 23
  • 2
  • if you are very luck [flush()](http://php.net/manual/en/function.flush.php) after each echo may work, but there's a lot of factors at pay here. have you considered a js approach? –  Mar 21 '13 at 02:52
  • 1
    `exec` will return when the command finishes. If you need to display at "real time", consider `
    ` and `system()` or `passthru()`.
    – Passerby Mar 21 '13 at 03:04
  • use `ob_end_flush()` and `ob_flush()` with `str_pad()` – Raptor Mar 28 '13 at 03:28

0 Answers0