PDA

Click to See Complete Forum and Search --> : [ASP]Response.clear >> what is its equivalen in PHP


oceanebelle
Jul 5th, 2005, 09:24 PM
Response.clear

does anyone know its equivalent in php ? :(

visualAd
Jul 6th, 2005, 02:16 AM
What does response.clear do?

mendhak
Jul 6th, 2005, 02:24 AM
It clears the buffered HTML output after the previous flush.

visualAd
Jul 6th, 2005, 04:55 AM
Yes there is an equivilent in PHP. However, you have to turn on output buffering. You can find information about it here (http://uk2.php.net/manual/en/ref.outcontrol.php).

Basically, you should use the ob_start() function to start the buffer and call ob_flush() whenever you want to flush the buffer. By default however, PHP handles all output control.

mendhak
Jul 6th, 2005, 05:04 AM
Same thing in ASP, you need to enable it first. Of course I didn't know its PHP equivalent nor do I think I'll ever use it. :afrog:

CornedBee
Jul 6th, 2005, 08:27 AM
I use output buffering only when I have something (an include file or a function) that writes to the console, but I really want it in a variable.

ob_start();
include('thefile.php');
$data = ob_get_contents();
ob_end_clean();

oceanebelle
Jul 6th, 2005, 08:20 PM
yup. already turned that on.. for header() to work.

uhm.
about flush() function.. what's its difference with ob_flush()?