TP5下Ajax ob_flush 不能输出

浏览:975 发布日期:2017/05/10 分类:ThinkPHP5专区 关键字: TP5 Ajax
 
  $flush = "<script type='text/javascript'> updateProgress('{$title}', $width); </script>"; 
   echo json_encode($flush);   
 // get the size of the output
// $size = ob_get_length();
 // send headers to tell the browser to close the connection
// header("Content-Length: $size");
// header('Connection: close'); 
  
  
  ob_end_flush();
 ob_flush();
 flush(); 
    sleep(1);
 
 /******** background process starts here ********/
 ignore_user_abort(true);//在关闭连接后,继续运行php脚本
 /******** background process ********/
// set_time_limit(0); //no time limit,不设置超时时间(根据实际情况使用)
 
在TP5下,控制Ajax实时进度条, 不能得到flush的返回值。应该如何实现?有没有实例。
最佳答案
评论( 相关
后面还有条评论,点击查看>>