public static function YamlFormArrayHelper::isAssociative in YAML Form 8
Determine if an array is an associative array.
Parameters
array $array: An array.
Return value
bool TRUE if array is an associative array.
See also
http://stackoverflow.com/questions/173400/how-to-check-if-php-array-is-a...
2 calls to YamlFormArrayHelper::isAssociative()
- YamlFormArrayHelper::isSequential in src/
Utility/ YamlFormArrayHelper.php - Determine if an array is a sequential array.
- YamlFormElementStates::isDefaultValueCustomizedFormApiStates in src/
Element/ YamlFormElementStates.php - Determine if an element's #states array is customized.
File
- src/
Utility/ YamlFormArrayHelper.php, line 54
Class
- YamlFormArrayHelper
- Provides helper to operate on arrays.
Namespace
Drupal\yamlform\UtilityCode
public static function isAssociative(array $array) {
return array_keys($array) !== range(0, count($array) - 1);
}