How to use array_chunk function in PHP?
In this post, We will use array_chunk function splits an array into chunks of new arrays in php.
1. Code:
2. Example:
Input:
array('php', 'laravel','java','html');
length = 2
Output:
Array ( [0] => Array ( [0] => php [1] => laravel ) [1] => Array ( [0] => java [1] => html ) )