Pop value from sub-array

@param array $array
@param string $key
@return mixed
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);
    }
30776
public static function deleteValue(&$array, $key)
    {
        if (is_string($key)) {
            // Iterate path
            $keys = explode('.', $key);
            $last = array_pop($keys);
            foreach ($keys as $key) {
                if (!isset($array[$key])) {
                    return;
                }
                $array = &$array[$key];
            }
            if (isset($array[$last])) {
                // Detele path
                unset($array[$last]);
            }
        } elseif (is_array($key)) {
            // Iterate array of paths
            foreach ($key as $k) {
                self::delete($k);
            }
        }
    }
943552
public static function fetch( $array, $key )
    {
        $result = [ ];

        foreach ( explode( '.', $key ) as $segment )
        {
            foreach ( $array as $value )
            {
                $value = ( array ) $value;

                $result[ ] = $value[ $segment ];
            }

            $array = array_values( $result );
        }

        return array_values( $result );
    }
565663
public function remove($key)
    {
        $key = is_array($key) ? $key : [$key];
        $config = $this->data;
        $data = &$config;
        while ($key) {
            $k = array_shift($key);
            if (!$key) {
                unset($config[$k]);
                break;
            }
            $config[$k] = isset($config[$k]) ? $config[$k] : [];
            $config = &$config[$k];
        }
        $this->data = $data;
        return $this->save();
    }
953053
public static function get($array, $key, $default = null)
	{
		if (!static::accessible($array))
			return value($default);

		if (is_null($key))
			return $array;

		if (static::exists($array, $key))
			return $array[(string) $key];


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

		return $array;
	}
119724
public static function sGet($array, $key, $default = null)
    {
        $value = self::get($array, $key);
        return !empty($value) ? $value : $default;
    }
915423
public static function tryGetKeysChainValue($array)
    {
        $arguments = func_get_args();
        $numArguments = func_num_args();

        $currentArray = $array;
        for ($i = 1; $i < $numArguments; ++$i) {
            if (is_array($currentArray)) {
                if (array_key_exists($arguments[$i], $currentArray)) {
                    $currentArray = $currentArray[$arguments[$i]];
                } else {
                    return null;
                }
            } else {
                return null;
            }
        }

        return $currentArray;
    }
49202
private function delete(array &$array, $key)
    {
        $key = trim($key, '.');
        if (strpos($key, '.') !== false) {
            $explode = explode('.', $key);
            $this->delete($array[$explode[0]], $explode[1]);
        } else {
            unset($array[$key]);
        }
    }
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;
	}
1105610
def pop(self, idx=None):
        
        if idx is not None:
            return self.database.run_script(
                'array_remove',
                keys=[self.key],
                args=[idx])
        else:
            return self.database.run_script(
                'array_pop',
                keys=[self.key],
                args=[])
1355081
public function pop($key) {
		$data = $this->get($key);
		if($data) {
			$this->delete($key);
		}
		return $data;
	}
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;
    }
682355
public static function pluck($array, $key)
    {
        return array_map(
            function ($v) use ($key) {
                return is_object($v) ? $v->$key : $v[$key];

            },
            $array
        );
    }
910332
private function flatten(array $array)
    {
        $single = array();
        if (isset($array['hier'])) {
            unset($array['hier']);
        }
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                foreach ($this->flatten($value) as $key => $value) {
                    $single[$key] = $value;
                }
            } else {
                $single[$key] = $value;
            }
        }

        return $single;
    }
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;
    }
284264
public static function delete(array &$array, string ...$keys)
    {
        if ($keys === []) {
            return;
        }

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

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

            $parts = \explode('.', $key);
            $delKey = \array_pop($parts);
            foreach ($parts as $part) {
                if (isset($array[$part]) && \is_array($array[$part])) {
                    $array = &$array[$part];
                } else {
                    continue 2;
                }
            }

            unset($array[$delKey]);
        }
    }
712016
public static function set( & $array, $key, $value)
	{
		if(is_null($key))
		{
			return $array = $value;
		}

		if(strpos($key, ".") !== false)
		{
			for( $i = 0, $keys = explode('.', $key), $count = count($keys); $i < $count; $i++ )
			{
				$key = $keys[$i];
				if( $i + 1 == $count )
				{
					break;
				}

				// If the key doesn't exist at this depth, we will just create an empty array
				// to hold the next value, allowing us to create the arrays to hold final
				// values at the correct depth. Then we'll keep digging into the array.
				if(! isset($array[$key]) || ! is_array($array[$key]))
				{
					$array[$key] = [];
				}

				$array = & $array[$key];
			}
		}

		$array[$key] = $value;

		return $array;
	}