Determine if an item or items exist in an multi-dimensional associative array using "dots" notation.

@param ArrayAccess|array $array
@param string|string[]   $keys
@param null|string       $wildcard

@return bool
555466
public static function has($array, $keys, $wildcard = null)
    {
        // If the keys are null or the array is not accessible
        if (null === $keys || empty($array) || !Arr::accessible($array)) {
            return false;
        }

        // Check that every key exists in $array
        $originalArray = $array;
        foreach ((array) $keys as $key) {
            $array = $originalArray;

            // If the array has the key carry on
            if (Arr::exists($array, $key)) {
                continue;
            }

            // Break up the key into segments and drill into the array
            $segments = explode('.', $key);
            foreach ($segments as $k => $segment) {
                // If the segment is a wildcard
                if ($segment === $wildcard && !empty($array)) {
                    // If this is the last segment then the array has the key
                    if ($k + 1 === count($segments)) {
                        break;
                    }
                    // If we are still considering an array, drill into every possibility
                    if (Arr::accessible($array)) {
                        // Check that at least one possibility contains the (sub)key
                        $subKey = implode('.', array_slice($segments, $k + 1));
                        $found  = array_reduce($array, function ($f, $item) use ($subKey, $wildcard) {
                            return $f || static::has($item, $subKey, $wildcard);
                        }, false);
                        if (!$found) {
                            return false;
                        } else {
                            break;
                        }
                    }
                }
                // Otherwise continue to drill into $array
                if (!empty($array) && Arr::accessible($array) && Arr::exists($array, $segment)) {
                    $array = $array[$segment];
                    continue;
                }
                return false;
            }
        }

        return true;
    }
651156
public static function findElementsByKey($array, $key, &$targetArray = null, $prefix = "") {

        if ($array instanceof AssociativeArray) {
            $array = $array->toArray();
        }

        if (!$targetArray)
            $targetArray = array();

        foreach ($array as $itemKey => $value) {

            if ($itemKey === $key) {
                $targetArray[substr($prefix . "." . $key, 1)] = $value;
            } else if (is_array($value) || $value instanceof AssociativeArray) {

                if (is_numeric($itemKey)) {
                    $newPrefix = $prefix . "[" . $itemKey . "]";
                } else {
                    $newPrefix = $prefix . "." . $itemKey;
                }

                ArrayUtils::findElementsByKey($value, $key, $targetArray, $newPrefix);
            }
        }

        return $targetArray;

    }
569757
public function has_any(array $keys) {
        foreach ($keys as $key) {
            if ($this->has($key)) {
                return true;
            }
        }
        return false;
    }
324285
public static function extract(array $keys, array $array, bool $setNull = false)
    {
        $newArray = [];
        foreach ($keys as $key) {
            if (array_key_exists($key, $array)) {
                $newArray[$key] = $array[$key];
            } else if ($setNull) {
                $newArray[$key] = null;
            }
        }
        return $newArray;
    }
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;
	}
17377
public static function pluck (array $array, $keys)
		{
			if (!is_array($keys))
			{
				$keys = func_get_args();
				array_shift($keys);
			}

			return array_intersect_key($array, array_flip($keys));
		}
58099
private function hasPath(array $keys, array &$source)
    {
        $key = array_shift($keys);

        if (!isset($source[$key])) {
            return false;
        }

        if (!$keys) {
            return true;
        } else {
            $value = & $source[$key];

            if ($value instanceof IConfig) {
                return $value->has(implode(self::PATH_SEPARATOR, $keys));
            } elseif (is_array($value)) {
                return $this->hasPath($keys, $value);
            } else {
                return false;
            }
        }
    }
432221
public static function pop(array $array, $key)
    {
        $keys = explode('.', $key);
        foreach($keys as $key) {
            if(!isset($array[$key])) {
                return null;
            }
            $array = $array[$key];
        }

        if(!is_array($array)) {
            return null;
        }

        return array_pop($array);
    }
223919
public function mget(array $keys)
    {
        return array_map(function ($value) {
            return $value !== false ? $value : null;
        }, $this->command('mget', [$keys]));
    }
366058
public static function has(array $array, string $key): bool
    {
        $check = self::dataByPath($array, $key, false, 'not.found');
        return $check !== 'not.found';
    }
871246
public static function getPrevKey($key, array $array) {
		$keys = array_keys($array);
		$found_index = array_search($key, $keys);
		if($found_index === false || $found_index === 0)
			return false;
		return $keys[$found_index - 1];
	}
937958
protected function existArrayKeys(array $keys, array $arraySearch): bool
    {
        $arraySearch = $this->formatResponseArray($arraySearch);

        foreach ($keys as $key) {
            if (!array_key_exists($this->formatKey($key), $arraySearch)) {
                return false;
            }
        }

        return true;
    }
1125809
public function hasAny( $keys = [] )
	{
		foreach ( $keys as $key )
		{
			if ( $this->has( $key ) )
			{
				return true;
			}
		}

		return false;
	}
1116179
public static function has(array $array, ...$keys): bool
    {
        $key = array_shift($keys);

        if (!isset($array[$key])) {
            return false;
        }

        if (empty($keys)) {
            return isset($array[$key]);
        }

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

        return self::has($array[$key], ...$keys);
    }
984685
public static function getItems($array, $keys = null)
    {
        if (is_null($keys)) {
            return $array;
        } elseif (is_scalar($keys)) {
            $keys = [$keys => $array[$keys]];
        }
        $res = [];
        foreach ($keys as $k) {
            if (array_key_exists($k, $array)) {
                $res[$k] = $array[$k];
            }
        }
        return $res;
    }
887802
public function keyExistsNested(array $array, string $needle): bool
    {
        // If the key exists in the first level...
        if (key_exists($needle, $array)) {
            // Return true
            return true;
        }

        // Search in the deeper levels of the array
        foreach ($array as $key => $value) {
            // If this value is an array...
            if (is_array($value)) {
                // ... First search for the key and if found...
                if (key_exists($needle, $value)) {
                    // ... Return true
                    return true;
                }

                // The $needle is not found: continue the search again
                $this->keyExistsNested($value, $needle);
            }
        }

        // Nothing: the $needle were not found: return false
        return false;
    }
1004966
public static function containsAllKeys(array $arr, array $keys)
    {
        foreach($keys as $key)
        {
            if( !isset( $arr[$key] ) )
                return false;
        }

        return true;
    }