Concept

How can you print the contents of a PHP array in a readable format?

ComputerScienceOne / Useful Functions

"For convenience and debugging, a special function, print_r() allows you to print the contents of an array in a human-readable format that resembles the key-value initialization syntax above. For example,\n\n$arr = array(\n\n\"foo\" => 5,\n\n4 => \"bar\",\n\n0 => 3.14,\n\n\"baz\" => \"ten\"\n\n);\n\nprint_r($arr);\n\nwould end up printing\n\nArray\n\n(\n\n[foo] => 5\n\n[4] => bar\n\n[0] => 3.14\n\n[baz] => ten\n\n)"

Related Ideas

How can you print the contents of a PHP array in a readable format? | ComputerScienceOne | Bifalgorithm | Bifalgorithm