Determines whether a nested array contains the requested keys.
This helper function should be used when the depth of the array element to be checked may vary (that is, the number of parent keys is variable). See drupal_array_set_nested_value() for details. It is primarily used for form structures and renderable arrays.
If it is required to also get the value of the checked nested key, use drupal_array_get_nested_value() instead.
If the number of array parent keys is static, this helper function is unnecessary and the following code can be used instead:
$value_exists = isset($form['signature_settings']['signature']);
$key_exists = array_key_exists('signature', $form['signature_settings']);
$array: The array with the value to check for.
$parents: An array of parent keys of the value, starting with the outermost key.
TRUE if all the parent keys exist, FALSE otherwise.
drupal_array_get_nested_value()
function drupal_array_nested_key_exists(array $array, array $parents) {
return NestedArray::keyExists($array, $parents);
}