You are here

function _features_is_assoc in Features 7

Same name and namespace in other branches
  1. 7.2 features.export.inc \_features_is_assoc()

Is the given array an associative array. This basically extracts the keys twice to get the numerically ordered keys. It then does a diff with the original array and if there is no key diff then the original array is not associative.

NOTE: If you have non-sequential numerical keys, this will identify the array as assoc.

Borrowed from: http://www.php.net/manual/en/function.is-array.php#96724

Return value

True is the array is an associative array, false otherwise

1 call to _features_is_assoc()
_features_sanitize in ./features.export.inc
"Sanitizes" an array recursively, performing two key operations:

File

./features.export.inc, line 891

Code

function _features_is_assoc($array) {
  return is_array($array) && (0 !== count(array_diff_key($array, array_keys(array_keys($array)))) || count($array) == 0);
}