Okay, say I have an array, $arr. I want to access $arr['a']['b']['c'].... And I have another array, $keys, that looks like this: ['a', 'b', 'c', ...]. How can I use $keys as the identifiers to access the sub element of $arr?
In other words, I basically want to do something along the lines of this: $arr[$keys[0]][$keys[1]][$keys[2]]. Except, in that example, I hardcoded it to work only if $keys has exactly three elements; that's no good, I want $keys to be of arbitrary length.
If I've successfully explained what I'm trying to do, can someone tell me if it's possible? Muchas gracias.
$arr, right?$keyswill indeed exist in$arr.$arrhas?$arrwill be N-dimensional, and$keyswill be of length N or less. I don't know what N is in advance. I'm thinking now that the solution to this is probably recursive, I might actually have an idea of the answer....