<?php $array = ['um', 'dois', 'tres', 'quatro', 'cinco', 'seis']; print_r( array_slice( $array, -3, 2 ) );
Standard input is empty
Array ( [0] => quatro [1] => cinco )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!