How can I retrieve data from an array, 3 at a time?

frop

New Member
Is there a better way in PHP to access this array in groups of three?Let's say my array is a comma separated string like :\[code\]("Thora","Birch","Herself","Franklin Delano","Roosevelt","Himself (archive footage)","Martin Luther","King","Himself (archive footage) (uncredited)")\[/code\]although the array can end up being much larger, each one will be different but still in logical groups of three (firstname, lastname, role).What I'm trying to accomplish is looping through the array in groups of three, so that the first record would have \[code\]firstname[0]=>"Thora", lastname[0]=>"Birch" and role[0]=>"Herself".\[/code\]I'm only used to \[code\]foreach\[/code\] loops but don't see an extra parameter like "for each 3" so maybe someone can shed some light?Thanks!
 
Back
Top