Trying to study some outputs of arrays and object by using for example print_r($wp_query); but it's really hard to read it, i have searched but what I found does not format well nested arrays, I wonder if there is a solution for this? Thank you
Asked
Active
Viewed 45 times
-1
Botond Vajna
- 869
- 1
- 8
- 19
-
1You can use ` – André Walker Dec 20 '20 at 18:51
1 Answers
0
Please take a look at VarDumper component. It could be used as a standalone and easily improve your array or object output.
composer require --dev symfony/var-dumper
<?php
require __DIR__.'/vendor/autoload.php';
$array = [
[
[
[
[
'some_key' => 'some_value',
],
],
],
],
];
dump($array);
The output would be the following.
^ array:1 [
0 => array:1 [
0 => array:1 [
0 => array:1 [
0 => array:1 [
"some_key" => "some_value"
]
]
]
]
]
Mikhail Prosalov
- 3,819
- 3
- 27
- 37