PHP: Loop function for every 50 items

Bulent

New Member
Situation: Got 160 ids in array, need to build xml requests, in sets of max 50 and submit each set separately. Problem: How to loop the function and continue with ID 51?function doBatch($ids)Simplified Code:\[code\]function doBatch($ids){ $start = "<feed>"; foreach($ids as $id) { $add .= '<entry>'$id.'</entry>'; } $stop = "</feed>"; $data = http://stackoverflow.com/questions/3890953/$start.$add.$stop; post($data);}\[/code\]
 
Back
Top