Pluck a subset of an array.

@param string $keys
@param array $arr
@return array
551669
private function pluckArray(array $keys, &$arr)
    {
        $values = [];

        foreach ($keys as $key) {
            if (array_key_exists($key, $arr)) {
                $values[$key] = $this->pluck($key, $arr, false);
            }
        }

        return $values;
    }
11836
public static function pluck( $array, $value, $key = NULL )
    {
        $result = [ ];

        foreach ( $array as $item )
        {
            $itemValue = is_object( $item ) ? $item->{$value} : $item[ $value ];

            if ( is_null( $key ) )
            {
                $result[ ] = $itemValue;
            }
            else
            {
                $itemKey = is_object( $item ) ? $item->{$key} : $item[ $key ];

                $result[ $itemKey ] = $itemValue;
            }
        }

        return $result;
    }
862256
private function createList(array $keys, array $values)
    {
        $list = [];

        foreach ($keys as $key) {
            if (array_key_exists($key, $values)) {
                $list[$key] = $values[$key];
            }
        }

        return $list;
    }
1004966
public static function containsAllKeys(array $arr, array $keys)
    {
        foreach($keys as $key)
        {
            if( !isset( $arr[$key] ) )
                return false;
        }

        return true;
    }
1138226
public static function wrapMany(array $keys)
    {
        foreach ($keys as &$key) {
            $key = self::wrap($key);
        }

        return $keys;
    }
126440
protected function neq($arr, $arr2, $keys): bool
    {
        return !$this->eq($arr, $arr2, $keys);
    }
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));
    }
1317638
public static function arrayGroup($arr, $key){
        $result = [];
        foreach($arr as $k=>$v){
            $result[$v[$key]][] = $v;
        }
        return $result;
    }
316151
private function pluck($key, array &$arr, $isRequired = true)
    {
        if (!array_key_exists($key, $arr)) {
            if ($isRequired) {
                throw new \InvalidArgumentException(
                    "Key $key does not exist in the provided array."
                );
            }

            return null;
        }

        $value = $arr[$key];
        unset($arr[$key]);
        return $value;
    }
578526
public static function combine(array $keys, array $values, $complete = TRUE) {
		$arr = array();
		if (!self::isAssoc($values) ) {
            for ($i = 0; $i < count($keys); $i++) {
                $arr[$keys[$i]] = isset($values[$i]) ? $values[$i] : null;
            }
            return $arr;
        }
        foreach ($keys as $key) {
        	if (isset($values[$key])) {
        		$arr[$key] = $values[$key];
        	} else if ($complete) {
        		$arr[$key] = null;
        	}
        }
		return $arr;
	}
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);
    }
154419
public function select(array $keys)
    {
        $list = [];
        foreach ($keys as $key) {
            if ($this->containsKey($key)) {
                $list[$key] = $this->get($key);
            }
        }

        return $this->createFrom($list);
    }
1241038
public function pullAll(array $keys, $valueDefault = null): array
    {
        return Arrays::pullAll($this->data, $keys, $valueDefault);
    }
18642
public static function pluck(array $array, $key)
    {
        return array_map(
            function ($item) use ($key) {
                return is_object($item) ? $item->$key : $item[$key];
            },
            $array
        );
    }
170742
public function filter($keys, $exclude = false): SplArray
    {
        if (is_string($keys)) {
            $keys = explode(',', $keys);
        }
        $new = array();
        foreach ($this->getArrayCopy() as $name => $value) {
            if (!$exclude) {
                in_array($name, $keys) ? $new[$name] = $value : null;
            } else {
                in_array($name, $keys) ? null : $new[$name] = $value;
            }
        }
        return new SplArray($new);
    }
129517
public static function pluck( $array, $key ) {
		$return = array();
		foreach ( $array as $obj ) {
			if ( is_object($obj) && method_exists($obj, $key) ) {
				$return[] = $obj->$key();
			} elseif ( is_object($obj) && property_exists($obj, $key) ) {
				$return[] = $obj->$key;
			} elseif ( is_array($obj) && isset($obj[$key]) ) {
				$return[] = $obj[$key];
			}
		}
		return $return;
	}
9968
public static function pluck(array $values, $key)
    {
        return array_map(
            function($val) use ($key) {
                return is_object($val) ? $val->{$key} : $val[$key];
            },
            $values
        );
    }