I have a very big multi dimenssional array and in that I have a key name of which I need to find the path so I can access it directly.
How do I search for keys using text search “some key” and it should show the path of all the matching keys.
So if i search for “some key”
then it should give result something like:
array[“level0”][“level1”][“somekey”] or something similar so that I know what is its path and how to access it directly.
Go to this page and search on the phrase “This function will extract keys from a multidimensional array”. There you will find someone has done two-thirds (if not all) of the work for you.
Thanks for the response but it just lists all the keys, i can already do that using print_r…what I want to achieve to find a specific key’s path in the multi dimensional array. If you look at the example provided by the function creator, it just lists the size array as 0,1,2 where as I want to find to which parent array it belongs to or maybe get its full array path from starting eg.: size > 0, size > 1, size > 2