How to capture content from the output buffer ? or Give me an example for Output caching in php?

<?php

ob_start(); // start an output buffer

echo ‘This text is from the w3answers buffer*******<br />’; // output that will be stored in the buffer

$w3buffer = ob_get_contents(); // store buffer content in $w3buffer variable

ob_end_clean(); // stop and clean the output buffer

echo ‘This is not from the w3answers buffer!!!!!!!!<br />’;

echo $w3buffer;

?>

O/p
*****

This is not from the w3answers buffer!!!!!!!!
This text is from the w3answers buffer*******

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.