PHP offers a number of methods that output a variable's contents which are useful when debugging code. I'm partial to var_dump for a few reasons I'll explain below.
Say we've got the following array and want to display its contents.
$test = array ('abc', false, true, 100, array('49'));
print_r() function - Displays human-readable output
 => abc
 => 1
 => 100
 => Array
 => 49
So print_r tells us that this variable holds an array and shows us the values.
But notice that the second and third elements don't reflect what we defined above. The $test value is shown as blank and $test is shown as 1. Why is that?
PHP implicitly converts boolean values to strings in cases like these. So false is converted to an empty string '' and boolean true is converted to '1'.
This can cause confusion if you don't understand what is happening. This leads me to the next function.
var_dump() function - Displays values and types
This is admittedly harder to read at first glance but the output gives you more information and accurately displays all values and types.
var_export() function - Outputs PHP code
0 => 'abc',
1 => false,
2 => true,
3 => 100,
0 => '49',
This output can be useful if you need to parse this somewhere else in your script.