If your on php 4.5 or above you can use the JSON_PRETTY_PRINT.
$json_string = json_encode($data, JSON_PRETTY_PRINT);
solved Display JSON File content using PHP [closed]
If your on php 4.5 or above you can use the JSON_PRETTY_PRINT.
$json_string = json_encode($data, JSON_PRETTY_PRINT);
solved Display JSON File content using PHP [closed]