<?php
    $a = array ('a' => 'apple', 'b' => 'banana', 'c' => array ('x','y','z'));
    print_r ($a);
?>

上边的代码将输出:

Array ( [a] => apple [b] => banana [c] => Array ( [0] => x [1] => y [2] => z ) )

Related Posts: PHP-print_r()函数直观输出数组 :