Printing the contents of a PHP Array
This is a pretty common task, but it’s surprising how many PHP newbies don’t know about it yet. If you want to see the structure of your PHP Array, all you need to do is this:
print_r($myarray);
This will give you a listing of all the items in the array, including multi-dimensional arrays. Obviously this should only be used for testing / debugging purposes.

Daily Email Updates
You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


and if you like it human-readable:
echo “”; print_r($myarray); echo “”;
have fun!
this is more human-readable :
echo ”;
print_r($array);
echo ”;
You may want to try this:
echo “”;
print_r($location);
echo “”;
echo “(html open tag)pre(html close tag)”;
print_r($location);
echo “\”;
echo “(less than sign)pre(greater than sign)”;
print_r($location);
echo “(less than sign)/pre(greather than sign)”;
between the quotes are the html pre tags (open and then close).
surprising how very helpful this post is for php newbies like me
thx alot!