php 缓冲技术中常用几个实例
来源:程序员人生 发布时间:2013-11-17 05:38:46 阅读次数:2706次
- <?php
-
- session_start();
-
- output_add_rewrite_var('var','value');
-
- echo '<a href="file.php教程">link</a>';
-
- ob_flush();
-
- output_reset_rewrite_vars();
-
- echo '<a href="file.php">link</a>';
-
-
- print_r(ob_list_handlers());
- ob_end_flush();
- ob_start("ob_gzhandler");
- print_r(ob_list_handlers());
- ob_end_flush();
- ob_start(create_function('$string','return $string;'));
- print_r(ob_list_handlers());
- ob_end_flush();
-
-
- if(ob_get_level()==0)
- ob_start();
- for($i=0;$i<10;$i++)
- {
- echo "<br>line to show.";
- echo str_pad('',4096)."n";
- ob_flush();
- flush();
- sleep(1);
- }
- echo "done.";
- ob_end_flush();
- ?>
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠