You are here

public static function ArrayUtils::hasIntegerKeys in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-stdlib/src/ArrayUtils.php \Zend\Stdlib\ArrayUtils::hasIntegerKeys()

Test whether an array contains one or more integer keys

Parameters

mixed $value:

bool $allowEmpty Should an empty array() return true:

Return value

bool

File

vendor/zendframework/zend-stdlib/src/ArrayUtils.php, line 60

Class

ArrayUtils
Utility class for testing and manipulation of PHP arrays.

Namespace

Zend\Stdlib

Code

public static function hasIntegerKeys($value, $allowEmpty = false) {
  if (!is_array($value)) {
    return false;
  }
  if (!$value) {
    return $allowEmpty;
  }
  return count(array_filter(array_keys($value), 'is_int')) > 0;
}