You are here

function _features_is_assoc in Features 7

Same name and namespace in other branches
  1. 7.2 \_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:

Return value

True is the array is an associative array, false otherwise

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


./, line 891


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