Web Analytics

PHP array_slice() Function

ArrayPHP 4+

The array_slice() function extracts a portion of an array and returns it, without modifying the original array.

Syntax

array_slice(array $array, int $offset, ?int $length = null, bool $preserve_keys = false): array

Try It Online

Output
Click Run to execute your code