If I have multiple html inputs all with an equal amount of array keys, but the keys are unknown, how can I get the value of the 3rd array key?
Example:
HTML
<input name="data[key1][key2][0]" />
<input name="data[key1][key2][1]" />
<input name="data[key1][key2][2]" />
What i'm looking for is the value of the 3rd key regardless of [key1][key2]. I need to get the value so I can reset indexes if an input is removed by the user.
So if a user removes the second input, the array is
<input name="data[key1][key2][0]" />
<input name="data[key1][key2][2]" />
I'd like to loop through the array and reset the indexes.
Any suggestions?