最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php ob_flush flush 输出缓存实例与说明
时间:2022-07-02 09:50:50 编辑:袖梨 来源:一聚教程网
ob_flush flush 输出缓存实例与说明
*/
ob_flush();
//
flush();
//
function flush (){
echo(str_repeat(' ',256));
// check that buffer is actually set before flushing
if (ob_get_length()){
@ob_flush();
@flush();
@ob_end_flush();
}
@ob_start();
}
//str_repeat(string,repeat) 把字符串重复指定的次数。
//实例二
@apache_setenv('no-gzip', 1);
@ini_set('zlib.output_compression', 0);
@ini_set('implicit_flush', 1);
for ($i = 0; $i ob_implicit_flush(1);
/*
使用注意事项:
flush和ob_flush的使用上有一些特别容易犯错的地方,造成无法刷新输出缓冲。
一. flush和ob_flush的正确顺序,正确应是,先ob_flush再flush,如下:
以下为引用的内容:
ob_flush();
flush();
如果web服务器的是windows系统,那顺序颠倒或者不使用ob_flush()也不会出现问题。但是在linux系统上就无法刷新输出缓冲。
二. 使用ob_flush()前,确保前面的内容大小足够4069字符。
一些web服务器的output_buffering默认是4069字符或者更大,即输出内容必须达到4069字符服务器才会flush刷新输出缓冲,为了确保flush有效
相关文章
- 王者荣耀星火赤壁英雄选择推荐 09-20
- 重返未来1999告死鸟角色介绍 09-20
- 重返未来1999野树莓技能介绍一览 09-20
- 少女前线2追放刘易斯技能是什么 刘易斯技能介绍一览 09-20
- 时隙之旅修普诺斯强度怎么样 修普诺斯强度角色介绍 09-20
- 二重螺旋妮弗尔夫人怎么玩 妮弗尔夫人玩法攻略 09-20