I have an array of profiles. I want to loop through them and print out the data for each person. I'm using bootstrap so I'd like to have 3 profiles per row and then start a new row for another 3 profiles, like the following:
<div class="row">
<div class="col-md-3">
Profile Data
</div>
</div>
If I loop through using foreach, I'll get a new row each profile, when I'd like 3 profiles and then a new row:
foreach($profiles as $p){
echo '<div class="row">
<div class="col-md-3">
'.$p->name.'
</div>
</div>';
}
Can anyone advise me?