I have an array of keys for a multidimensional array, and I want to get the value of it (if possible, first checking if it even exists). For example, I have the following array:
$keys = array( 'markets', 0, 'orders', 0, 'parameters', 'planType' );
And from this, I need to programmatically get the value of this:
$request['markets'][0]['orders'][0]['parameters']['planType']
I feel like I'm overcomplicating this...The only method I could think of was with the use of eval, but this seems very potentially insecure:
eval("\$value = \$request['" . implode("']['", $keys) . "'];")
echo $value;