Print Variable Json PHP

-2

I have a json

$data= '[ { "opa": "maam", "clik": "7026981995", "pt": 123, "aaab": [{ "ttt": "1.22", "tt": [{ "aaa2": 1.2277, "aaa122": 19811225 }] }] }, { "opaa": "maam1", "clik1": "7026981995", "pt1": 123, "aaa11": [{ "ttt1": "1.222", "tt1": [{ "aaa1": 1.2277, "aaa3": 19811225 }] }] } ]'

I need to print it on the screen, just as it is in the variable, I tried

echo json_encode($data, JSON_PRETTY_PRINT);

But a stack is printed, not legible.

    
asked by anonymous 07.08.2018 / 01:53

1 answer

0

Resolved

echo '<pre>'.print_r(json_decode($data), true).'</pre>';

    
07.08.2018 / 02:48