About OB output related issues

Source: Internet
Author: User
About OB output issues

Ob_start ();
echo str_repeat ("", 4098);
for ($i =65; $i <70; $i + +) {
echo Chr ($i);
Ob_flush ();
Flush ();
Sleep (1);
}
?>


Ask the above code in IE,FF is normal, you can output ABCDE in turn, and in Google Browser cannot be displayed sequentially, but once output ABCDE, originally thought is Google cache too big increase str_repeat for 9000 is still an output, do not know what is the reason?
------Solution--------------------
I don't know, 360 what's the speed of the kernel

Originally this kind of output is very boring, previously only know the server-related, and now has a browser-related
Visible success becomes a small probability event.
No practical value, no need to focus on it


------Solution--------------------
if (ob_get_level () = = 0) ob_start ();

for ($i = 0; $i <10; $i + +) {

echo "
Line to show. ";
Echo Str_pad (' 1 ', 4096). " \ n ";
Echo str_repeat ("1", 4098);
Ob_flush ();
Flush ();
Sleep (2);
}

echo "done.";

Ob_end_flush ();
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.