array_chunk()
function array_chunk(array $array, int $length, bool $preserve_keys = false): array
Splits an array into chunks of the given size.
Parameters:
$array(array)$length(int)$preserve_keys(bool), defaultfalse, optional
Returns: array
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/array/array_chunk.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how array_chunk is implemented in the compiler, see the internals page.