+1 for print_r(). Use it to dump out the contents of an object or variable. To make it more readable, do it with a pre tag so you don't need to view source.
echo '';
print_r($arrayOrObject);
Also var_dump($thing) - this is very useful to see the type of subthings