I have an multidimensional array which has images names and image label. This array sometimes gets as large as over 100K. I need to split this array into small chunks lets says 10K chunks as I need to get image name from each array and add that image which is stored locally into zip file.
Example of array:
Array (
[0] => Array ( [sku] => 1 [image] => 1-gbc.jpg [image_label] => 1 GBC EB100000)
[1] => Array ( [sku] => 2 [image] => 2-ib575037.jpg [image_label] => 2 IB575037)
[2] => Array ( [sku] => 3 [image] => 3-s0190303-paper-mate.jpg [image_label] => 3 Paper Mate S0190303 )
)
I need to split this into smaller chunks because it sometimes get impossible to add all the images for one array into single zip files which is why I need to create separate zip for each array chunk.
I have tried to user array_chunk but it is not working for me am I doing something wrong.
images = array_chunk($array, 10000);
array_chunk? php.net/manual/en/function.array-chunk.php