So I've developed some code to pull the latest 8 images from my flickr feed; however, I'm having trouble with figuring out how to do what I'm trying to do. Essentially, I need each 4th image to have a different <div> class (this helps with margins and what not). Any suggestions on how to get this working? Here's the code I have now which displays the 8 images in a row
foreach($images->photos->photo as $photo) {
echo '<div><a href="http://flickr.com/photos/' . $flickr->username . '/' . $photo->attributes()->id . '"><img src="http://farm' . $photo->attributes()->farm . '.static.flickr.com/' . $photo->attributes()->server . '/' . $photo->attributes()->id . '_' . $photo->attributes()->secret . '_s.jpg" width="55" height="55" alt="flickr"/></a></div>';