Heromantor
Guest
Попробуй так:
PHP:
function dumpFoo($foo)
{
ob_start();
$args = &func_get_args();
unset($args[0]);
if(substr($foo, 0, 5) == 'eval:')
{
$code = ltrim(substr($foo, 5)).'(';
for($i = 1, $count = sizeof($args); $i <= $count; $i++)
{
$code .= var_export($args[$i], true).($i < $count ? ',' : '');
}
$code .= ');';
eval($code);
}else call_user_func_array($foo, &$args);
$return = &ob_get_contents();
ob_end_clean();
return $return;
}
$content = dumpFoo('eval: include', 'demo.php');