<?php
$arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5);
echo json_encode($arr);
?>
The above example will output:
{"a":1,"b":2,"c":3,"d":4,"e":5}
How can I make the out put like this following
{"a":1,
"b":2,
"c":3,
"d":4,
"e":5}
or like
{
"a":1,
"b":2,
"c":3,
"d":4,
"e":5
}
Make it easy for human reading, specially when json has long text value to return.
An ugly solution I did before is instead of call json_encode on $arr, but instead, I can loop through $arr, can json_encode on each array element and attach link break after each json encoded array element.
But I don't want to do that.