Home  >  Article  >  Backend Development  >  Several examples commonly used in php buffering technology_PHP tutorial

Several examples commonly used in php buffering technology_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 16:55:01817browse

//Initialize session
session_start();
//Add the value of url rewrite
output_add_rewrite_var('var','value');
//Insert a connection
echo 'link';
//Send buffer data
ob_flush();
//Reset the value of url rewrite
output_reset_rewrite_vars();
//Insert a connection
echo 'link';

/*

*/

print_r(ob_list_handlers()); //List the output handlers used, and the default output handler
will be output ob_end_flush(); //Send buffer data and close the buffer
ob_start("ob_gzhandler"); //Open the buffer and use ob_gzhandler
print_r(ob_list_handlers()); //List the output handles, ob_gzhandler
will be output ob_end_flush(); //Send buffer data and close the buffer
ob_start(create_function('$string','return $string;')); //Open buffer
print_r(ob_list_handlers()); //List the output handlers used, and the default output handler
will be output ob_end_flush(); //Send buffer data and close the buffer

/*

*/

if(ob_get_level()==0) //Determine the buffer level, if there is no active buffer
ob_start(); //Open buffer
for($i=0;$i<10;$i++) //Loop execution operation
{
echo "
line to show."; //Output content
echo str_pad('',4096)."n"; //Output the generated string
ob_flush(); //Send buffer data
flush(); //Refresh the buffer
sleep(1); //Pause for 1 second
}
echo "done."; //Output operation completion mark
ob_end_flush(); //Send buffer data and close the buffer

?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631708.htmlTechArticle//Initialize session session_start(); //Add the value of url rewrite output_add_rewrite_var('var','value' ); //Insert a connection echo 'a href=file.php tutorial link/a'; //Send buffer data...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn