PHP print output array content and structure function Print_r and var_dump
Print_r () function
Example:
<?php $arr _test =array (1, 2, 3); Print_r ($arr _test);? >
Run the example output:
Array ( [0] = 1 [1] = 2 [2] = 3)
Var_dump () function
Example:
<?php$arr_test = Array (1, 2,3); Var_dump ($arr _test);? >
Run the example output:
Array (3) { [0]=> int (1) [1]=> int (2) [2]=> int (3)}
The Var_dump () function is the same as the Print_r () function usage. However, the Var_dump () function is more powerful than print_r () and can print multiple variables at the same time and give the type information of the variables.
The above describes the PHP print output array content and structure functions Print_r and var_dump, including the aspects of the content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!