A
A
Anton Seredny2016-03-02 18:32:09
PHP
Anton Seredny, 2016-03-02 18:32:09

Are there services for visualizing complex arrays?

Good afternoon, please advise some service to make it easier to work with complex nested arrays.
Here is an example of an array in which both objects and arrays...

array(1) { [0]=> object(stdClass)#5434 (2) { ["columnRows"]=> array(1) { [0]=> object(stdClass)#5441 (2) { ["row"]=> string(16) "homepageLayout_2" ["columns"]=> array(2) { [0]=> object(stdClass)#5435 (2) { ["layoutID"]=> string(7) "column9" ["layoutRows"]=> array(1) { [0]=> object(stdClass)#5433 (2) { ["row"]=> string(16) "homepageColumn_0" ["layoutColumns"]=> array(1) { [0]=> object(stdClass)#5432 (2) { ["columnID"]=> string(8) "column12" ["contentBlocks"]=> array(1) { [0]=> object(stdClass)#5431 (2) { ["blocksContentName"]=> string(19) "homepage_news_block" ["blocksContent"]=> array(6) { ["trendyblog_style_141"]=> string(1) "3" ["trendyblog_title_142"]=> string(8) "Блог" ["trendyblog_count_143"]=> string(2) "12" ["trendyblog_type_144"]=> string(1) "1" ["trendyblog_cat_145"]=> array(2) { [0]=> string(1) "1" [1]=> string(2) "15" } ["trendyblog_offset_146"]=> string(0) "" } } } } } } } } [1]=> object(stdClass)#5430 (2) { ["columnID"]=> string(7) "column3" ["contentBlocks"]=> array(1) { [0]=> object(stdClass)#5429 (2) { ["SidebarName"]=> string(0) "" ["blocksContent"]=> array(0) { } } } } } } } ["fieldCount"]=> int(181) } }

Through the browser (viewing the code), it seems to be built into the structure more or less, but it is still perceived very hard.
4AkOXBpcM53bdA.jpg
How is it more pleasant to display all this in order to make it easier to navigate, otherwise I was sitting for a long time building a similar chain to access an array element? or maybe there is a simpler way, and not like mine:
$key_1_value[0]->columnRows[0]->columns[0]->layoutRows[0]->layoutColumns[0]->contentBlocks[0]->blocksContent['trendyblog_cat_145']

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2016-03-02
@smidl

Install xdebug
xdebug-var_dump-1.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question