/*************by Jiangong SUN******************/
The var_dump function displays structured information about variables/expressions including its type and value. Arrays are explored recursively with values indented to show structure.
print_r() displays information about a variable in a way that's readable by humans. array values will be presented in a format that shows keys and elements. Similar notation is used for objects.
There is a similar function to print_r(), which is var_dump(). It does largely the same thing, but a) prints out sizes of variables, b) does not print out non-public data in objects, and c) does not have the option to pass a second parameter to return its output. For example, altering the first script to use var_dump() rather than print_r() would give the following output:
$myarray = array("Apples", "Oranges", "Pears");
$size = count($myarray);
print_r($myarray);
var_dump($myarray);
Array(
[0] => Apples
[1] => Oranges
[2] => Pears
)
array(3) {
[0]=>
string(6) "Apples"
[1]=>
string(7) "Oranges"
[2]=>
string(5) "Pears"
}