...

PHP equivalent of response buffer true?

gorilla1
08-07-2002, 01:16 AM
Is there a php equivalent of the ASP: Response.Buffer = true
(which causes all scripts to be executed before anything gets rendered to the page.)

G

gorilla1
08-07-2002, 02:05 AM
I gather ob_start must be it?

G

firepages
08-07-2002, 12:11 PM
yup - thats it ...

i.e. readfile($file) in PHP outputs the contents of file directly to screen & there is no normal way of manipulating its contents but you can use ob_start() & friends



<?
ob_start();
//can't normally get at the files contents (using readfile())
readfile('yaks.txt');
//so grab the contents of the buffer//
$str = ob_get_contents();
//do something pointless to $str... because we can//
$str=nl2br(strrev($str));
ob_end_clean();
echo $str;
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum