NestedArray::getValue

public static function NestedArray::getValue

public static &NestedArray::getValue(array &$array, array $parents, &$key_exists = NULL)

Retrieves a value from a nested array with variable depth.

This helper function should be used when the depth of the array element being retrieved may vary (that is, the number of parent keys is variable). It is primarily used for form structures and renderable arrays.

Without this helper function the only way to get a nested array value with variable depth in one line would be using eval(), which should be avoided:

// Do not do this! Avoid eval().
// May also t