note 85014 added to function.ob-end-clean

From: Date: Sun, 10 Aug 2008 23:39:26 +0000
Subject: note 85014 added to function.ob-end-clean
Groups: php.notes 
Request: Send a blank email to php-notes+get-143351@lists.php.net to get a copy of this message
In reference to <geoff at spacevs dot com> where he states, "If you call ob_end_clean in a function registered with 'register_shutdown_function', it is too late, any buffers will have already been sent out to the client.", here is a workaround I came up with. <?php function ClearBuffer($Buffer) { return ""; } function Shutdown() { ob_start("ClearBuffer"); } register_shutdown_function("Shutdown"); ?> This will wipe out all the contents of the output buffer as it comes in. Basically its the same as "STDOUT > /dev/null". ---- Server IP: 208.69.120.35 Probable Submitter: 216.194.119.220 ---- Manual Page -- http://www.php.net/manual/en/function.ob-end-clean.php Edit -- https://master.php.net/note/edit/85014 Del: integrated -- https://master.php.net/note/delete/85014/integrated Del: useless -- https://master.php.net/note/delete/85014/useless Del: bad code -- https://master.php.net/note/delete/85014/bad+code Del: spam -- https://master.php.net/note/delete/85014/spam Del: non-english -- https://master.php.net/note/delete/85014/non-english Del: in docs -- https://master.php.net/note/delete/85014/in+docs Del: other reasons-- https://master.php.net/note/delete/85014 Reject -- https://master.php.net/note/reject/85014 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#143351) next »