PHP connection_aborted() not working correctly

前端 未结 5 1448
北荒
北荒 2021-01-14 07:47

I have the following code:

ignore_user_abort(true);
while(!connection_aborted()) {
    // do stuff
}

and according to the PHP documentation

5条回答
  •  孤独总比滥情好
    2021-01-14 08:11

    Try using ob_flush(); just before flush(); and some browsers just won't update the page before some data is added.

    Try doing something like

    
    

    Google Chrome has issues with this code, actually; it doesn't support streaming very nicely.

提交回复
热议问题