Returns true only if given input is an array with all of it's keys of type string.
@param  mixed $arr
@return bool  True if array contains all string keys. Otherwise, false.
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));
    }
800312
public static function filter_keys($arr, $keys)
    {
        foreach ($arr as $key => $v) {
            if (!in_array($key, $keys)) {
                unset($arr[$key]);
            }
        }

        return $arr;
    }
241806
public static function arrayKeyLower($arr)
    {
        return array_map(function($item){
            if(is_array($item)) {
                $item = self::arrayKeyLower($item);
            }
            return $item;
        },array_change_key_case($arr,CASE_LOWER));
    }
1368227
public function hasAny($keys)
    {
        $keys = is_array($keys) ? $keys : func_get_args();

        $input = $this->all();

        foreach ($keys as $key) {
            if (Arr::has($input, $key)) {
                return true;
            }
        }

        return false;
    }
324479
public static function inArray($aValues, array $aArray): bool
    {
        if (is_string($aValues)) {
            $aValues = (array) $aValues;
        }

        foreach ($aValues as $sValue) {
            if (in_array($sValue, $aArray)) {
                return true;
            }
        }
        return false;
    }
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]];
	}
24131
public static function sanitizeArray(&$arr)
    {
        foreach ($arr as $k => $v) {
            if (is_string($v)) {
                $arr[$k] = self::sanitizeInput($v);
            }
        }
    }
905414
private function isAssocStr($array)
    {
        if(!is_array($array)){
            return false;
        }
        for (reset($array); is_int(key($array));
             next($array)) {
            if (is_null(key($array)))
                return false;
        }
        return true;
    }
70786
public static function isAssoc(array $array): bool
    {
        if (empty($array)) {
            return false;
        }

        foreach (array_keys($array) as $key) {
            if (\is_string($key)) {
                return true;
            }
        }

        return false;
    }
602366
public function writeArray(array $arr) {

            //Check if this is an associative array or not.
            if ( $this->isPureArray( $arr ) ) {
              // Writing the length for the numeric keys in the array
              $arrLen = count($arr);
              $arrId = ($arrLen << 1) | 0x01;
  
              $this->writeInt($arrId);
              $this->writeString('');
  
              foreach($arr as $v) {
                  $this->writeAMFData($v);
              }

            } else {
                $this->writeInt(1);
                foreach($arr as $key=>$value) {
                    $this->writeString($key);
                    $this->writeAMFData($value);
                }
                $this->writeString('');

            }

        }
257209
protected static function strContains($str, array $arr)
    {
        foreach ($arr as $a) {
            if (stripos($str, $a) !== false) {
                return true;
            }
        }
        return false;
    }
950549
public function _is_associative_array($arr) {
		foreach ( array_keys($arr) as $key => $val ) {
			if ($key!==$val) {
				return TRUE;
			}
		}
		return FALSE;
	}
701188
protected function isSingleCharStringList(array $strings)
	{
		foreach ($strings as $string)
		{
			if (!$this->isSingleCharString($string))
			{
				return false;
			}
		}

		return true;
	}
252116
public static boolean isStringArrayEmpty(String[] arr) {
        boolean empty = true;
        if (arr != null) {
            if (arr.length > 0) {
                for (String s : arr) {
                    if (StringUtils.isNotBlank(s)) {
                        empty = false;
                        break;
                    }
                }
            }
        }
        return empty;
    }
169553
private function validateArrayType($value): bool
    {
        if (is_array($value) === false) {
            return false;
        }
        $count = 0;
        foreach ($value as $i => $item) {
            //not a array, but a hash/map
            if ($count !== $i) {
                return false;
            }
            $count++;
        }
        return true;
    }
20090
protected function isArrayWithNonNumericKeys($value)
    {
        if (!is_array($value)) {
            return false;
        }

        foreach ($value as $key=>$value) {
            if (is_numeric($key)) {
                return false;
            }
        }

        return true;
    }
1104252
public static function has($array, $keys)
	{
		if(is_null($keys) || !$array)
			return false;

		$keys = static::toArray($keys);

		if($keys === [])
			return false;

		foreach ($keys as $key) {
			$subKeyArray = $array;

			if (static::exists($array, $key))
				continue;

			foreach (static::toKey($key) as $segment) {
				if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment))
					$subKeyArray = $subKeyArray[$segment];
				else
					return false;
			}
		}

		return true;
	}