I am making a project in PHP that pulls pictures from a Facebook page using Facebook SDK. I am using a loop to echo 40 different images, I want to distribute these images evenly between 4 different bootstrap columns as shown below.
Column1 Column2 Column3 Column4
Image1 Image2 Image3 Image4
Image5 Image6 Image7 Image8
The loop I am currently using to echo images into one column:
foreach($rData as $post) {
$image = ('<center><img class="img-responsive" src="'.$post->getProperty('full_picture').'"/>'.'</br></center>');
print('<div class="col-sm-12">'.$image.'</div');
}
I've spent quite some time trying to figure this out but can never seem to distribute the data without having it repeat. Any help would be appreciated, thanks in advance.