PHP split array in hundreds
<p>I have an array that can hold up to several thousands of items.(usually around 5000 items).
I need to split this array into hundreds and process them and then continue with the rest of items.
So far i handle the whole array which is slow. 
My code is</p>

<pre><code>foreach($result as $p){
                $sqlQuery = mysql_query("INSERT INTO message_details(contact, message_id)VALUES('$p', $message_last_id)");
                $last_id = mysql_insert_id();
                $xmlString .= "&lt;gsm messageId=\"$last_id\"&gt;".$p."&lt;/gsm&gt;";
                $cnt++;
            }
</code></pre>

<p>How can i process the items in the array in hundreds? Eg. 100, then 200, then 300 etc</p>

<p>Best Regards,
Nicos</p>
