指定された階層にある値を取得します。

@param	array	$array	配列
@param	mixed	$keys	階層
@return	mixed	指定された改造にある値
518525
public static function GetLowest ($array, $keys) {
		foreach ((array) $keys as $key) {
			if (isset($array[$key]) || array_key_exists($key, $array)) {
				$array = $array[$key];
			} else {
				return null;
			}
		}
		return $array;
	}
1327815
public static function forget(&$array, $keys)
	{
		$original = &$array;

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

		if (count($keys) === 0)
			return;

		foreach ($keys as $key) {
			// if the exact key exists in the top-level, remove it
			if (static::exists($array, $key)) {
				unset($array[(string) $key]);
				continue;
			}

			$parts = static::toKey($key);

			// clean up before each pass
			$array = &$original;

			while (count($parts) > 1) {
				$part = $parts->shift();

				if (static::exists($array, $part) && static::accessible($array[$part]))
					$array = &$array[$part];
				else
					continue 2;
			}

			unset($array[$parts->shift()]);
		}
	}
1060825
public static function removeKeys($array, $removeKeys)
    {
        $result = [];
        if (!is_array($removeKeys)) {
            $removeKeys = [$removeKeys];
        }
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $value = self::removeKeys($value, $removeKeys);
            }
            if (in_array($key, $removeKeys)) {
                continue;
            } else {
                $result[$key] = $value;
            }
        }
        return $result;
    }
892943
public static function arrayPluck($array, $key)
    {
        return array_map(function($value) use ($key) {
            return is_object($value) ? $value->$key : $value[$key];
        }, $array);
    }
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;
    }
715819
public static function removeKeysFromMultiArray(&$array, $keys)
    {
        foreach ($array as $key => &$value) {
            if (is_array($value)) {
                self::traverseArray($value, $keys);
            } else {
                if (in_array($key, $keys) || '' == $value) {
                    unset($array[$key]);
                }
            }
        }

        return $array;
    }
317802
private function _arrayShiftAssoc(array &$array)
    {
        if (empty($array)) {
            return null;
        }
        
        // Make sure that the array variable is pointing to the beginning of the array
        reset($array);
        
        // Now, get the first key and first value
        $firstKey   = key($array);
        $firstValue = current($array); // equivalent to $array[$firstKey]
        
        unset($array[$firstKey]);
        
        return [$firstKey, $firstValue];
    }
933433
public static function ExistsLowest ($array, $keys) {
		foreach ((array) $keys as $key) {
			if (isset($array[$key])) {
				$array = $array[$key];
			} else {
				return false;
			}
		}
		return true;
	}
1033343
private function arrayFilterRecursive(array &$array)
    {
        foreach ($array as $key => &$item) {
            is_array($item) && $array[$key] = $this->arrayFilterRecursive($item);
            if ($array[$key] === null ||
                $array[$key] === []
            ) {
                unset($array[$key]);
            }
        }
        return $array;
    }
1101391
public static function filter_keys($array, $keys, $remove = false)
    {
        $return = array();
        foreach ($keys as $key) {
            if (array_key_exists($key, $array)) {
                $remove or $return[$key] = $array[$key];
                if ($remove) {
                    unset($array[$key]);
                }
            }
        }
        return $remove ? $array : $return;
    }
711239
public function unsetFilter($array, $keys) {
		if(is_array($array)) {
			if(!is_array($keys)) {
				$keys = array(
					$keys 
				);
			}
			foreach($keys as $key) {
				if(array_key_exists($key, $array)) {
					unset($array[$key]);
				}
			}
		}
		return $array;
	}
789321
public static function has( $array, $key )
	{
		if ( !$array )
			return false;

		if ( is_null( $key ) )
			return false;

		if ( static::exists( $array, $key ) )
			return true;

		foreach ( explode( '.', $key ) as $segment )
			if ( static::accessible( $array ) && static::exists( $array, $segment ) )
				$array = $array[$segment];
			else
				return false;

		return true;
	}
847053
protected function & getFromArray(&$array, $keys, $default = null)
    {
        $key = array_shift($keys);
        if (!isset($array[$key])) {
            return $default;
        }

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

        return $this->getFromArray($array[$key], $keys, $default);
    }
858813
public static function remove(array $array, string $key): array
    {
        // Extract key/path.
        $keyLast = Str::last($key, '.');
        $key = Str::removeLast($key, '.');

        // If found, remove element.
        $arrayElement = &self::dataByPath($array, $key, false, 'not.found');
        if ($arrayElement !== 'not.found') {
            if (array_key_exists($keyLast, $arrayElement)) {
                unset($arrayElement[$keyLast]);
            }
        }

        return $array;
    }
340718
public static function has(array $array, string ...$keys): bool
    {
        if ($array === [] || $keys === []) {
            return false;
        }

        foreach ($keys as $key) {
            if (isset($array[$key])) {
                continue;
            }

            $subKeyArray = $array;
            foreach (\explode('.', $key) as $segment) {
                if (\is_array($subKeyArray) && isset($subKeyArray[$segment])) {
                    $subKeyArray = $subKeyArray[$segment];
                } else {
                    return false;
                }
            }
        }

        return true;
    }
962591
public static function forget(&$array, $keys) {
        $original = &$array;

        $keys = (array) $keys;

        if (count($keys) === 0) {
            return;
        }

        foreach ($keys as $key) {
            // if the exact key exists in the top-level, remove it
            if (array_key_exists($key, $array)) {
                unset($array[$key]);
                continue;
            }

            $parts = explode('.', $key);

            // clean up before each pass
            $array = &$original;

            while (count($parts) > 1) {
                $part = array_shift($parts);

                if (isset($array[$part]) && is_array($array[$part])) {
                    $array = &$array[$part];
                } else {
                    continue 2;
                }
            }

            unset($array[array_shift($parts)]);
        }
    }
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);
    }