ob_start()是开启output buffering,也就是缓冲输入内容,ob_gzhandle使用gzip处理内容,作为ob_start的参数,表示当输入缓冲内容时使用的回调函数,你也可以自己定义回调函数.
例如手册中的例子:
<?php function callback( $buffer ) { // replace all the apples with oranges return ( str_replace ( "apples" , "oranges" , $buffer )); } ob_start( "callback" ); ?> <html> <body> <p>It's like comparing apples to oranges.</p> </body> //开源代码phpfensi.com </html> <?php ob_end_flush(); ?>输出时,内容中的apples会变成oranges,你可以试试去掉ob_start中的callback,看看有什么不同.
查看更多关于php ob_start()缓存技术的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did29734