I used the print_r
function to print array fetched from a table in database. Instead of a nicely formatted array like this:
Array
(
[0] => Array
(
[id] => 1
[firstname] => Firstname one
[lastname] => Lastname one
)
[1] => Array
(
[id] => 2
[firstname] => Firstname two
[lastname] => Lastname two
)
[2] => Array
(
[id] => 3
[firstname] => Firstname three
[lastname] => Lastname three
)
)
I got inline results, like this:
Array ([0] => Array ([id] => 1 [firstname] => Firstname one [lastname] => Lastname one ) [1] => Array ([id] => 2 [firstname] => Firstname two...
This is a simple example, my actual array is nested three times, so the result is a massive block of inline string that makes readability hard.
Why do I get results such as this?