K
K
khodos_dmitry2017-11-07 11:22:22
PHP
khodos_dmitry, 2017-11-07 11:22:22

How to conveniently view arrays and json?

Is there any function or class?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergej, 2017-11-07
@khodos_dmitry

If you need to display beautifully, the json you output.
You can use the plugin for chrome.
https://chrome.google.com/webstore/detail/jsonview...

A
Alexander, 2017-11-07
@zkelo

Arrays: print_r() , var_dump()
JSON: json_decode()

R
romasovest, 2018-05-06
@romasovest

To conveniently view large arrays, I display them like this:

<? echo 'var my_beauty_object = JSON.parse(`'.json_encode($my_big_array).'`);<br>console.clear();<br>console.log(my_beauty_object);'; ?>
then received in the chrome developer console and I get a beautiful collapsible / expandable json object

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question