- print_r: documentation ( source)
<?php
class TestObject {
public $stuff;
}
$obj = new TestObject();
$obj->stuff = array('1' => 'a', '2' => 'b', '3' => 'c');
print_r($obj->stuff);
foreach ($obj->stuff as $k => $v) {
echo "\n$k => $v; ";
echo $obj->stuff[$k];
}