OK I'm not really sure how to put it but I will try my best to explain my question. Basically I am really lost when it comes to arrays and for loops, so I need help badly.
I have in my HTML Form about 20 checkboxes like this:
echo "<input type='checkbox'
name='pro_id[{$row['product_id']}]'
value='Box #{$row['product_id']}' checked>";
The values product_id is taken from my database.
When the user submits, it'll run:
foreach($_POST['pro_id'] as $_id => $_label)
{chunkofcodes}
But now, what I need to do is to actually limit the $_POST and group them by 7s, and run that "chunkofcodes" using the first 7 values, the next 7 values, and the remainder of the values, in this case 20 - 7 - 7 = 6. Please note that the number of checkboxes is not permanently 20; it may even be more.
So if I'm not wrong, I'm supposed to work with for loops, right? But I am really lost.
first, how do i "group" the values in an array of 7?
next, how do i use that array to run the "chunkofcodes" one after another?