fork(4) download
  1. <?php
  2.  
  3. $array = ['um', 'dois', 'tres', 'quatro', 'cinco', 'seis'];
  4.  
  5. print_r( array_slice( $array, -3, 2 ) );
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
Array
(
    [0] => quatro
    [1] => cinco
)