Re: Show Results one at a time ?
| From: | Rob Adams | Date: | Thu, 29 Jan 2004 13:54:56 +0000 |
| Subject: | Re: Show Results one at a time ? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-176196@lists.php.net to get a copy of this message | ||
If you're using the command line, ignore this comment.
"Dave Carrera" <dave@ephgroup.com> wrote in message
news:002801c3e66c$4cb395c0$0301a8c0@daveslaptop...
> --- updated with Sleep() ---
> function TestFunc(){
> $cnt = array(1,2,3,4,5,6,7,8,9,10);
> $i=0;
>
> while($i <=count($cnt)){
> //sleep(1);
> set_time_limit(2);
> //sleep(1);
> echo $cnt[$i].str_repeat(" ", 300) . "<br />";;
> sleep(1);
> ob_flush();
> flush();
> //sleep(1);
> $i++;
> }
> --- End ---
>
> Wherever I put sleep(1), notice the comments, in the func all it dose is
> wait 10 seconds then shows the full output and not each result 1 at a time
> to the screen.
This is probably due to the browser you are using. I've noticed that IE
tends to not show everything on a page until the entire page (or a certain
element) has finished loading, while Mozilla tries to display data as it
comes. I'm not accusing you of using IE, but you might want to try a
different browser or technique to see if that displays more like you would
expect.
>
> Any further guidance is very much appreciated.
>
> Dave C
>
-- Rob