Check whether the given array is associative or indexed.
@param array $arr
@return bool
324699
public static function isIndexedArray($arr)
    {
        if (!is_array($arr)) {
            return false;
        }
        if (array_values($arr) === $arr) {
            return true;
        }
        return false;
    }
407070
public static function isIndexedArray(array $query)
    {
        if (empty($query) || !isset($query[0])) {
            return false;
        }

        return array_keys($query) === range(0, count($query) - 1);
    }
377022
public static function isValidExtension(string $str, array $arr) : bool
    {
        $fE = explode(".", $str);
        $fE = "." . $fE[count($fE) - 1];

        return in_array($fE, $arr);
    }
8620
protected static function isArrayObject($arr)
    {
        foreach(array_keys($arr) as $key) {
            if (!is_int($key)) {
                return true;
            }
        }

        return false;
    }
31510
public static function isArrayAccessible($value): bool
    {
        if (is_array($value)) {
            return true;
        }

        if (is_object($value) && ($value instanceof ArrayAccess)) {
            return true;
        }

        return false;
    }
780725
public function isAssociative(array $array)
    {
        if (empty($array)) {
            return false;
        }

        for ($iterator = count($array) - 1; $iterator; $iterator--) {
            if ( ! array_key_exists($iterator, $array)) {
                return true;
            }
        }

        return ! array_key_exists(0, $array);
    }
913370
public static function isArray($value)
    {
        if (is_array($value)) {
            return !$value || array_keys($value)[0] === 0;
        }

        // Handle array-like values. Must be empty or offset 0 exists.
        return $value instanceof \Countable && $value instanceof \ArrayAccess
            ? count($value) == 0 || $value->offsetExists(0)
            : false;
    }
727210
public function isSequentialArray($array)
    {
        $counter = 0;
        foreach ($array as $key => $value) {
            if ($counter !== $key) {
                return false;
            }
            $counter++;
        }

        return true;
    }
170589
public static function doesArrayContainOnlyStringKeys($arr)
    {
        if (!is_array($arr) || empty($arr)) {
            return false;
        }

        return count(array_filter(array_keys($arr), 'is_string')) == count(array_keys($arr));
    }
1121129
function getTokenFromArray( $arr ) {
    if (isset($arr['access_token']) && $arr['access_token']) {
      $token = array();
      $this->access_token = $token['access_token'] = $arr['access_token'];
      if (isset($arr['refresh_token']) && $arr['refresh_token']) {
        $this->refresh_token = $token['refresh_token'] = $arr['refresh_token'];
      }

      return $token;
    } else {
      return false;
    }
  }
994724
public static function isAssoc(array $arr): bool
    {
        if (array() === $arr)
            return false;
        return array_keys($arr) !== range(0, count($arr) - 1);
    }
1032637
public static function isIterator($arr) {
        if (!is_array($arr)) {
            return false;
        }

        foreach (array_keys($arr) as $key) {
            if (!is_numeric($key)) {
                return false;
            }
        }

        return true;
    }
78588
public function isMultiArray(): bool
    {
        return !(
            \count($this->getArray(), \COUNT_NORMAL)
            ===
            \count($this->getArray(), \COUNT_RECURSIVE)
        );
    }
257209
protected static function strContains($str, array $arr)
    {
        foreach ($arr as $a) {
            if (stripos($str, $a) !== false) {
                return true;
            }
        }
        return false;
    }
576456
public function isPrimitiveTypesOrRecursiveArrayOfPrimitiveTypes() {
		if ($this->isPrimitiveType()) {
			return true;
		}
		if ($this->subType) {
			return $this->subType->isPrimitiveTypesOrRecursiveArrayOfPrimitiveTypes();
		}
		return false;
	}
106024
public static function isArrayKeyExists($key, $arr)
    {
        if (!self::isValidArray($arr)) {
            return false;
        }

        return array_key_exists($key, $arr);
    }
1369590
public static function array_pop_rand(array &$arr) {
		$length = \count($arr);

		if (! $length) {
			return false;
		}

		// Nothing random about an array with one thing.
		if (1 === $length) {
			return static::array_pop_top($arr);
		}

		$keys = \array_keys($arr);
		$index = static::random_int(0, $length - 1);

		return $arr[$keys[$index]];
	}