checks if the array has an item with dottet dimensions

@param string		$key
@param array		$arr
@return bool
15083
public static function has( $key, $arr ) 
	{	
		if ( isset( $arr[$key] ) ) 
		{
			return true;
		}

		if ( strpos( $key, '.' ) !== false ) 
		{
			$kp = explode( '.', $key );

			switch ( count( $kp ) ) {
				case 2:
					return isset( $arr[$kp[0]][$kp[1]] ); break;
				case 3:
					return isset( $arr[$kp[0]][$kp[1]][$kp[2]] ); break;	
				case 4:
					return isset( $arr[$kp[0]][$kp[1]][$kp[2]][$kp[3]] ); break;

				// if there are more then 4 parts loop trough them
				default:
					$curr = $arr;
					foreach( $kp as $k ) 
					{
						if ( isset( $curr[$k] ) ) {
							$curr = $curr[$k];
						} else { 
							return false; 
						}
					}
					return true;
				break;
			}
		}
		return false;
	}
8620
protected static function isArrayObject($arr)
    {
        foreach(array_keys($arr) as $key) {
            if (!is_int($key)) {
                return true;
            }
        }

        return false;
    }
770565
public function exists( $key ) {
		return ! collect( is_array( $key ) ? $key : func_get_args() )->contains(
			function ( $key ) {
				return ! Arr::exists( $this->attributes, $key );
			}
		);
	}
614700
public static function doteToArr($key = '', &$arr = [], $default = null)
    {
        if (!strpos($key, '.')) {
            return isset($arr[$key]) ? $arr[$key] : $default;
        }

        // 获取多维数组
        $key = explode('.', $key);
        $tmp = null;
        foreach ($key as $k) {
            if (is_null($tmp)) {
                if (isset($arr[$k])) {
                    $tmp = $arr[$k];
                } else {
                    return $default;
                }
            } else {
                if (isset($tmp[$k])) {
                    $tmp = $tmp[$k];
                } else {
                    return $default;
                }
            }
        }
        return $tmp;
    }
994724
public static function isAssoc(array $arr): bool
    {
        if (array() === $arr)
            return false;
        return array_keys($arr) !== range(0, count($arr) - 1);
    }
461054
public static function isKeyWithElements($array, $key)
    {
        if (false === is_array($array) || false === isset($array[$key])) {
            return false;
        }

        if (false === is_array($array[$key])) {
            return false;
        }

        if (0 === count($array[$key])) {
            return false;
        }

        return true;
    }
536800
public static function average( $arr, $key = null ) 
	{
		if( !is_array( $arr ) ) 
		{
			throw new \InvalidArgumentException('CCArr::average - first argunent has to be an array.');
		}

		if ( is_string( $key ) && CCArr::is_multi( $arr ) ) 
		{
			$arr = CCArr::pick( $key, $arr );
		}

		return ( static::sum( $arr ) / count( $arr ) );
	}
100092
public function containsKey($key)
    {
        if (strpos($key, ".") !== false) {
            //we have a dot, we need to split the ket by the dot and check
            //individual string if they are part of the nestes array
            $keys = explode('.', $key);
            $keysCount = count($keys);
            
            
            $tmpArray = $this->properties;
            foreach ($keys as $index=>$subKey) {
             
                
                if (empty($tmpArray) || empty($subKey))
                {
                    return false;
                } 
                else if ($index+1 < $keysCount)
                {
                    //arizzini: if the current $index is not the last $subKey
                    //we want to check is the $tmpArray is an array
                    $tmpArray = $this->getArrayObject($tmpArray, $subKey);
                }
                else {
//                  echo "checking if subkey=$subKey exists";
//                  print_r($tmpArray);
                    //
                    return $this->getArrayObject($tmpArray, $subKey) !== null;
                    //return array_key_exists($subKey, $tmpArray);
                    
                }
            }
        } else {
            return $this->getArrayObject($this->properties, $key) !== null;
            
        }
        
    }
750944
public static function isAssoc(array $arr)
    {
        return (is_array($arr) && (!count($arr) || count(array_filter(array_keys($arr),'is_string')) == count($arr)));
    }
369851
public static function sum( $arr, $key = null ) 
	{	
		if( !is_array( $arr ) ) 
		{
			throw new \InvalidArgumentException('CCArr::sum - first argument has to be an array.');
		}

		$sum = 0;

		if ( is_string( $key ) && CCArr::is_multi( $arr ) ) 
		{
			$arr = CCArr::pick( $key, $arr );
		}

		foreach ( $arr as $item ) 
		{
			if ( is_numeric( $item ) ) 
			{
				$sum += $item;	
			}
		}

		return $sum;
	}
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;
    }
794782
protected function isArray($key) : bool
    {
        if (is_array($this->param[$key]) && !$this->hasAttribute($key)) {
            $this->errors[$key.self::ERROR] = $this->convertToFieldName($key).' value must be valid array.';
            return false;
        }

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

		$keys = (array) $keys;
		if($keys === [])
		{
			return false;
		}

		foreach($keys as $key)
		{
			if(static::exists($array, $key))
			{
				continue;
			}

			if( strpos($key, ".") !== false )
			{
				$subKeyArray = $array;
				for($i = 0, $map = explode('.', $key), $len = count($map); $i < $len; $i++)
				{
					$segment = $map[$i];
					if( ($i < 1 || static::accessible($subKeyArray)) && static::exists($subKeyArray, $segment) )
					{
						if( $i + 1 < $len )
						{
							$subKeyArray = $subKeyArray[$segment];
						}
					}
					else
					{
						return false;
					}
				}
			}
		}

		return true;
	}
1222616
public function containsKey($key): bool
    {
        return isset($this->items[$key]) || array_key_exists($key, $this->items);
    }
1108674
private function hasMetadataArrayInfo($key, $metadata = null)
    {
        return null !== $metadata && \array_key_exists($key, $metadata) && ($metadata[$key] instanceof \Traversable || \is_array($metadata[$key]));
    }
252279
public static function exists($key, $array)
    {
        if (!is_array($array)) {
            return false;
        }
        if ($key == '') {
            return is_array($array) && array_key_exists((string)$key, $array);
        }
        return self::parseAndValidateKeys($key, $array)['isExists'];
    }
409768
public static function exists(array $array, $key)
    {
        //
        if (array_key_exists($key, $array)) {
            return true;
        }
        //
        $keys = dot($key);
        //
        foreach ($keys as $key) {
            if (array_key_exists($key, $array)) {
                $array = (array) $array[$key];
                continue;
            } else {
                return false;
            }
        }
        //
        return true;
    }