src/Neutrino/Support/Arr.php
public static function pluck($array, $value, $key = null)
    {
        $results = [];

        list($value, $key) = self::explodePluckParameters($value, $key);

        foreach ($array as $item) {
            $itemValue = self::get($item, $value);

            // If the key is "null", we will just append the value to the array and keep
            // looping. Otherwise we will key the array using the value of the key we
            // received from the developer. Then we'll return the final array form.
            if (is_null($key)) {
                $results[] = $itemValue;
            } else {
                $itemKey = self::get($item, $key);

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

        return $results;
    }
public static function pluck($array, $value, $key = null)
    {
        $results = [];

        list($value, $key) = self::explodePluckParameters($value, $key);

        foreach ($array as $item) {
            $itemValue = self::get($item, $value);

            // If the key is "null", we will just append the value to the array and keep
            // looping. Otherwise we will key the array using the value of the key we
            // received from the developer. Then we'll return the final array form.
            if (is_null($key)) {
                $results[] = $itemValue;
            } else {
                $itemKey = self::get($item, $key);

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

        return $results;
    }
Pluck an array of values from an array.

@param \ArrayAccess|array $array
@param string|array       $value
@param string|array|null  $key

@return array