I have a string that contains elements from array.
$str = \'[some][string]\'; $array = array();
How can I get the value of $array[\'some\
$array[\'some\
This will work for any number of keys:
$keys = explode('][', substr($str, 1, -1)); $value = $array; foreach($keys as $key) $value = $value[$key]; echo $value