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


Top Questions

<?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.
4 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Check It !

Tweet It

W3 Updates

Stay informed on our latest news!

Syndicate content