SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard Dangermouse's Avatar
    Join Date
    Oct 2003
    Posts
    1,024
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ob / while / sleep

    Lets say i wanted to echo "hello" every second, how would i do this? I have tried it in a while(true) loop and using some ob flush'ing, but it just wont print it

  2. #2
    SitePoint Wizard Dangermouse's Avatar
    Join Date
    Oct 2003
    Posts
    1,024
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got it!

    PHP Code:
    <?
    set_time_limit
    (0);

    while(
    true) {
       echo 
    "Hello<br>";
       
    flush();
       
    ob_flush();
       
    sleep(1);
    }
    ?>

  3. #3
    SitePoint Evangelist Daijoubu's Avatar
    Join Date
    Oct 2002
    Location
    Canada QC
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is this for?
    I hope you aren't going to make it generate infinite js popup
    Speed & scalability in mind...
    If you find my reply helpful, fell free to give me a point


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •