Jump to content

Finding the key of a value of an array when that value is an array


gwolgamott

Recommended Posts

Running a recursive function iterating through an array.

So I get the values as needed, but I need somehow to put into this function the key of that value...

 

for example have this array

Array ( [Man Sys Do] => Array (  
                      [Random] => Array ( [0] => LINK_ME ) 
                      [s  & R] => Array (
                             [Recieving] => Array ( [0] => LINK_ME ) 
                              [shipping] => Array ( [0] => LINK_ME ) 
                                                 ) 
                                                 )
        )

 

How do find out that after going through a function to print this or whatever and say I have the LINK_ME how do I then afterwards before leaving my function determine what its key was and if that key had a key itself and so on...  so I can get something like this  "Man Sys Do" : "S & R" : "Shipping" -> LINK_ME

 

EDIT: would this best be done with a variable passed to my recursive function?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.