Returns a new array with the keys $keys

@param array $array an associative array
@param array $keys some keys
@return array
424594
public static function extractKeys($array, $keys) {
		$result = [ ];
		foreach ( $keys as $key ) {
			if (isset ( $array [$key] )) {
				$result [$key] = $array [$key];
			}
		}
		return $result;
	}
1273690
private function iteratorFromKeys(array $keys)
    {
        $values = [];
        $key    = ($this->request->qtype === 'eq')
            ? $this->request->key
            : null;

        foreach ($keys as $value) {
            $entry = new IndexEntry();

            $entry->indexKey  = $key;
            $entry->objectKey = $value;

            $values[] = $entry;
        }

        return new ArrayIterator($values);
    }
1134499
public static function &changeArrayKey( &$array, $key='id' ) {
        $newArray = array();
        foreach ( $array as $value ) $newArray[$value[$key]] = $value;
        return $newArray;
    }
194754
public function only(array $keys) : Assoc
    {
        return $this->pipe(
            function (array $values) use ($keys) : array {
                foreach ($values as $key => $_) {
                    if (!in_array($key, $keys)) {
                        unset($values[$key]);
                    }
                }

                return $values;
            }
        );
    }
423995
public static function array_pick($array) {
    if (!is_array( $array )) {
      return $array;
    }
    $keys = array_slice(func_get_args(), 1);
    $keys = self::array_flatten($keys);
    $pick = array();
    foreach ( $keys as $key ) {
      if (!array_key_exists($key, $array)) {
        continue;
      }
      $pick[$key] = $array[$key];
    }
    return $pick;
  }
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;
    }
882136
public static function GetElementsByKeys (array $array, array $keys) {
		return array_filter(array_combine($keys, array_map(function ($key) use ($array) {
			return isset($array[$key]) ? $array[$key] : null;
		}, $keys)));
	}
1119654
public function flatKeys(array $keys): array
    {
        $this->search = $keys;
        return $this->flatCollection($this->collection->toArray());
    }
241170
private function filterByKeys(array $keys)
    {
        $results = [];

        foreach ($this->items as $key => $value) {
            if (!in_array($key, $keys)) {
                continue;
            }

            $results[$key] = $value;
        }

        return $results;
    }
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));
		}
79110
public function arrayKeysSnakeRecursive($array)
    {
        $result = [];

        $array = arrayable($array) ? $array->toArray() : $array;

        array_walk($array, function ($value, $key) use (&$result) {
            $result[snake_case($key)] = arrayable($value) || is_array($value)
                ? $this->arrayKeysSnakeRecursive($value)
                : $value;
        });

        return coollect($result);
    }
782086
public function many(array $keys)
    {
        $results = [];

        $values = $this->connection()->mget(array_map(function ($key) {
            return $this->prefix.$key;
        }, $keys));

        foreach ($values as $index => $value) {
            $results[$keys[$index]] = ! is_null($value) ? $this->unserialize($value) : null;
        }

        return $results;
    }
756233
protected function iteratorToArray($keys)
    {
        // Already array
        if (is_array($keys)) {
            return $keys;
        }

        // Handle iterable
        if ($keys instanceof Traversable) {
            return iterator_to_array($keys, false);
        }

        // Error
        $keysType = is_object($keys) ? get_class($keys) : gettype($keys);
        throw new InvalidArgumentException("Cache keys must be array or Traversable, \"{$keysType}\" given");
    }
157698
public static function filterKeys ($array, $keys)
		{
			if (is_array($array))
			{
				$return = [];
				if (!is_array($keys))
					$keys = [ $keys ];
				foreach ($keys as $key)
					if (isset($array[ $key ]))
						$return[ $key ] = $array[ $key ];

				return $return;
			}

			return null;
		}
583796
public static function multiToAssoc(array $arrays)
    {
        $results = [];
        foreach ($arrays as $key => $value) {
            if (self::isReallyArray($value) === true) {
                $results = array_merge($results, self::multiToAssoc($value));
            } else {
                $results[$key] = $value;
            }
        }

        return $results;
    }
49781
public function toArray(array $keys = [])
    {
        $data = parent::toArray($keys);

        if (in_array('url', $keys) || empty($keys)) {
            $data['url'] = $this->getUrl();
        }

        if (in_array('is_selected', $keys) || empty($keys)) {
            $data['is_selected'] = (bool) $this->getIsSelected();
        }

        return $data;
    }
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;
	}