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\
// trim the start and end brackets $str = trim($str, '[]'); // explode the keys into an array $keys = explode('][', $str); // reference the array using the stored keys $value = $array[$keys[0][$keys[1]];