I have been working on this problem, but i have had no result with current functions of PHP.
I have a multidimensional array, like:
Array
(
[3] => Array
(
[16] => 0
[17] => 1
[18] => 2
)
[4] => Array
(
[22] => 3
[23] => 4
)
[5] => Array
(
[1] => 5
)
)
If the first keys of array were static, it would have been easy to fix, but all the keys are dynamical data. (3, 4, 5 etc...). I like to have a function that finds the keys of a value.
myFunction($myArray, 3) // 3 = my value.
If there is a value "3", I want function to give me the keys of it. (4, 22). Just like the array on the top.
Thanks in advance.
3in parameter, it would givesArray [4, 23]. If there is a value "3", what you call value ? Because in your array, the only value I see is[22] => 3, so its key is22, and the key of its key is4. So it would output[4, 22]and not like you said[4, 23]. Or am I wrong ?