PHP » GoLang |
login |
register |
about
|
array_chunk(PHP 4 >= 4.2.0, PHP 5, PHP 7) array_chunk — Split an array into chunks Description
array array_chunk
( array
$array
, int $size
[, bool $preserve_keys = FALSE
] )
Chunks an array into arrays with Parameters
Return Values
Returns a multidimensional numerically indexed array, starting with zero,
with each dimension containing Errors/Exceptions
If Examples
Example #1 array_chunk() example
<?phpThe above example will output:
Array
(
[0] => Array
(
[0] => a
[1] => b
)
[1] => Array
(
[0] => c
[1] => d
)
[2] => Array
(
[0] => e
)
)
Array
(
[0] => Array
(
[0] => a
[1] => b
)
[1] => Array
(
[2] => c
[3] => d
)
[2] => Array
(
[4] => e
)
)
|
more
Most requested
more
Last requests
|