<?php function slice_recursive(array $array, int $skip, int $keep) { if (!$array) { return $array; } return array_merge( array_slice( array_splice($array, 0, $skip + $keep), $skip ), slice_recursive($array, $skip, $keep) ); } var_export( slice_recursive(range(1, 13), 2, 3) );
You have javascript disabled. You will not be able to edit any code.