print_r ob_start

If you try to use print_r with ob_start(), you get error.

so you need some tricks.

[php]
ob_start("callback");

function callback($buffer){
$arr = array(1,2,3);

print_r($arr);

$buffer= ob_get_contents();

return $buffer;
}
[/php]