note 45870 deleted from function.array-chunk by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 22 Sep 2004 19:29:03 +0000 |
| Subject: | note 45870 deleted from function.array-chunk by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77175@lists.php.net to get a copy of this message | ||
Note Submitter: Mark El-Wakil mark at seventhcycle d net
----
If you want to split an array into x number of arrays (instead of multiple arrays of x size), this
function should do the trick:
function array_bigchunk($arr, $num)
{
return array_chunk($arr, ceil(sizeof($arr) / $num));
}
It's a small function that ends up doing what some people may have thought array_chunk would
have done.