If you're dealing with very big arrays in PHP, this function may help:
function recursive_print ($varname, $varval) {
if (! is_array($varval)):
print $varname . ' = ' . var_export($varval, true) . ";<br>\n";
else:
print $varname . " = array();<br>\n";
foreach ($varval as $key => $val):
recursive_print ($varname . "[" . var_export($key, true) . "]", $val);
endforeach;
endif;
}
It basically dumps the whole array where each element is in separate line, which is beneficial to find the right full paths for certain elements.
Example output:
$a = array();
$a[0] = 1;
$a[1] = 2;
$a[2] = array();
$a[2][0] = 'a';
$a[2][1] = 'b';
$a[2][2] = 'c';
See: How to export PHP array where each key-value pair is in separate line?