Ob_start ([string output_callback])-Open output buffer
All output information is not sent directly to the browser, but is stored in the output buffer, the optional callback function is used to process the output information.
Ob_end_flush-End (send) the contents of the output buffer, close the output buffer
*/
Ob_start ();//Open buffer
echo "Hello World"; Output content
$out =ob_get_clean (); Get buffer contents and end buffer
$out =strtolower ($out); Convert a character to lowercase
Var_dump ($out); Output Results
//
if (!function_exists (' Ob_clean '))//Determine if the function is defined
{
function Ob_clean ()//define Functions
{
if (@ob_end_clean ())
{
return Ob_start ();
}
Trigger_error ("Ob_clean () failed to delete buffer.no buffer to delete.", E_user_notice);
return false;
}
}
//
Header (' content-type:multipart/x-mixed-replace;boundary=endofsection '); Send headers
print "N--endofsectionn"; Output content
$PMT =array ("-", "" "," | ","/"); Defining arrays
for ($i =0; $i <10; $i + +)//operation via loop
{
Sleep (1); Pause execution
print "content-type:text/plainnn"; Output content
Print "Part $it". $PMT [$i% 4]; Output content
print "--endofsectionn"; Output content
Ob_flush (); Send buffer data
Flush (); Refresh output buffering
}
print "content-type:text/plainnn"; Output content
Print "The Endn"; Output content
print "--endofsection--n"; Output content
http://www.bkjia.com/PHPjc/444811.html www.bkjia.com true http://www.bkjia.com/PHPjc/444811.html techarticle Ob_start ([string output_callback])-Open output buffer All output information is not sent directly to the browser, but is saved in the output buffer, the optional callback function is used to ...