PHP sets the code that outputs the result while executing

  • 2020-10-23 20:03:50
  • OfStack


<?php    
 set_time_limit(10);    
 ob_end_clean();     // Close the output buffer before looping the output    

 echo str_pad('',1024);   
 // The browser is accepting output 1 Buffered output is not displayed before a fixed length content. This length value  IE is 256 Firefox is 1024   
 for($i=1;$i<=100;$i++){    
  echo $i.'<br/>';    
  flush();    // Flush output buffer    
  sleep(1);    
 }    
?> 

Related articles: