php ob

1476 ワード

ob output buffering   ,       ,   output cache,         ,      CPU  。
 
  
     ob_start  ,         (echo )        ,         ,      ob_flush    、ob_clean  、ob_get_contents            。
               :                header(  cookie ),              ;                 、  、  、        。
 
  
ob_clean — Clean (erase) the output buffer
ob_end_clean — Clean (erase) the output buffer and turn off output buffering
ob_end_flush — Flush (send) the output buffer and turn off output buffering
ob_flush — Flush (send) the output buffer
ob_get_clean — Get current buffer contents and delete current output buffer
ob_get_contents — Return the contents of the output buffer
ob_get_flush — Flush the output buffer, return it as a string and turn off output buffering
ob_get_length — Return the length of the output buffer
ob_get_level — Return the nesting level of the output buffering mechanism
ob_get_status — Get status of output buffers
ob_gzhandler — ob_start callback function to gzip output buffer
ob_implicit_flush — Turn implicit flush on/off
ob_list_handlers — List all output handlers in use
ob_start — Turn on output buffering
output_add_rewrite_var — Add URL rewriter values
output_reset_rewrite_vars — Reset URL rewriter values
    : phpinfo()        .
ob_start(); 
phpinfo(); 
$phpinfo = ob_get_contents(); 
//      
ob_clean();