public static function pluck(?string $key = null, ?array $array = null): array
    {
        if (!Any::isArray($array) || !Any::isStr($key)) {
            return [];
        }

        $output = [];
        foreach ($array as $item) {
            $object = $item[$key];
            if (!self::in($object, $output)) {
                $output[] = $object;
            }
        }
        return $output;
    }
public static function pluck(?string $key = null, ?array $array = null): array
    {
        if (!Any::isArray($array) || !Any::isStr($key)) {
            return [];
        }

        $output = [];
        foreach ($array as $item) {
            $object = $item[$key];
            if (!self::in($object, $output)) {
                $output[] = $object;
            }
        }
        return $output;
    }
public static function pluck ( ? string $ key = null , ? array $ array = null ) : array { if ( ! Any :: isArray ( $ array ) || ! Any :: isStr ( $ key ) ) { return [ ] ; } $ output = [ ] ; foreach ( $ array as $ item ) { $ object = $ item [ $ key ] ; if ( ! self :: in ( $ object , $ output ) ) { $ output [ ] = $ object ; } } return $ output ; }
Extract from multi-array elements by key to single-level array
@param string $key
@param array $array
@return array
Extract from multi - array elements by key to single - level array