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