You are here

public static function ArrayUtils::hasStringKeys in Zircon Profile 8.0

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

Test whether an array contains one or more string keys

Parameters

mixed $value:

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

Return value

bool

File

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

Class

ArrayUtils
Utility class for testing and manipulation of PHP arrays.

Namespace

Zend\Stdlib

Code

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