Is there a way in php to find out exactly where my element was inserted into an array i.e. at which postion it was inserted into the array. For like the following code I need to insert an element at any position of the array then insert a sub element at the second diimenson of that array
$myarray=array();
$myarray[]=$someelementdefinedbefore;
$myarray[][2]=$second element related to some element defined before;
i.e. i need the two elements mentioned above to be clubbed together so i can later access them both via a single array search
Any idea how I could make this work. I mean I know I could use array search for this but I wanted to know if there was more efficient solution available?