I have an nxn array, which recursively I'm trying to get certain value based on the following:
I would like to search for specific value (needle), in this case 'KEYVAL_TO_FIND'
if it is found, then, since that part of the array will always have the same structure, I would like to get 'MY_VALUE'
.
How could I achieve this? Thanks
An example of how the array look like (ignore the keys):
[0] = Array
(
[0] = Array
(
[0] = Array
[0] = KEYVAL_TO_FIND
[1] = Array
(
[0] = CONST
[1] = MY_VALUE
)
)
[1] = VAL
[2] = Array
(
[0] = FOO
[1] = BAR BAZ
)
)