Best way to do this is
echo "<pre>".print_r($array,true)."</pre>";
Example:
$array=array("foo"=>"999","bar"=>"888","poo"=>array("x"=>"111","y"=>"222","z"=>"333"));
echo "<pre>".print_r($array,true)."</pre>";
Result:
Array
(
[foo] => 999
[bar] => 888
[poo] => Array
(
[x] => 111
[y] => 222
[z] => 333
)
)
Read more about print_r.
About the second parameter of print_r "true" from the documentation:
When this parameter is set to TRUE, print_r() will return the
information rather than print it.