Home  >  Article  >  Backend Development  >  The difference between flush(), ob_flush(), and ob_end_flush() in php

The difference between flush(), ob_flush(), and ob_end_flush() in php

WBOY
WBOYOriginal
2016-07-25 09:05:42878browse
  1. //Prevent browser caching
  2. echo str_repeat(" ",1024);
  3. for($i=0;$i<5;$i++){
  4. echo $i;
  5. sleep(1);
  6. flush();//It will output a number every 1s. If you use ob_flush(), it will wait for 5s to output together
  7. }
  8. ?>
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn