php 缓冲技术中常用几个实例
栏目:php教程时间:2013-11-17 05:38:46
- <?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();
- ?>
------分隔线----------------------------
------分隔线----------------------------