|
Posted by Razzbar on 04/23/07 20:16
I've been trying to write a general buffer function that looks
something like this:
function buffer($arg){
ob_start();
$arg;
return ob_get_clean();
}
Note that the intention is for this to be used with functions that
produce output.
If $arg is a function like,
function a(){ echo "this is a"; }
and passed to the buffer function, it will be evaluated (pass by
value) and echo its output. I'd like to supress the output. Passing by
reference like .... buffer(&$arg) .... still causes an evaluation of
the function, and output being spit out.
Is there a way functions which produce output can be passed to another
function without being evaluated and emitting output?
Navigation:
[Reply to this message]
|