Quote:
Originally Posted by efhx
how would that be done?
|
PHP Code:
function func()
{
ob_start();
printf("This is a string within %s", __FUNCTION__);
$cont = ob_get_contents();
ob_end_clean();
return $cont;
}
$s = func();
printf("Calling func resulted in: %s", $s);
If the content is before the capture, this is an indication that a result is printed before the capture. I wouldn't recommend that you actually use output buffering, instead you should track down where it creates the output in the first place.
If you didn't write the code and don't know where to find it, the easiest thing I can think of is to reflect it instead using:
ReflectionFunction::export('getCustomField'); and looking where its @@ for its file (required 5.0+). But if you didn't write the function in the first place, you should not change how it's handled. Chances are though, if you have an output based method, there is also a captured one that can be called instead.