PHP div for every 12 images

aroflwaffle

New Member
i have this piece of code:\[code\]<?include( "http://api.flickr.com/services/feeds/photos_public.gne?id=22352410@N07&lang=en-us&format=php" );$i = 0; foreach($feed['items'] as $item) { preg_match("/<img src=http://stackoverflow.com/"([^\"]+)\" .*? \/>/", $item['description'], $matches); $img_html = $matches[0]; $img_src = http://stackoverflow.com/questions/3653705/$matches[1]; $medium_url = ereg_replace("_m", "_s", $img_src); echo "$img_html"; }?>\[/code\]How I could make that each N number of pictures appear inside of a \[code\]<div></div>\[/code\] Example:\[code\]<div class="container"><img src="http://stackoverflow.com/questions/3653705/1.jpg" /> <img src="http://stackoverflow.com/questions/3653705/2.jpg" /> <img src="http://stackoverflow.com/questions/3653705/3.jpg" /> <img src="http://stackoverflow.com/questions/3653705/4.jpg" /> <img src="http://stackoverflow.com/questions/3653705/5.jpg" /> <img src="http://stackoverflow.com/questions/3653705/6.jpg" /> <img src="http://stackoverflow.com/questions/3653705/7.jpg" /> <img src="http://stackoverflow.com/questions/3653705/8.jpg" /> <img src="http://stackoverflow.com/questions/3653705/9.jpg" /> <img src="http://stackoverflow.com/questions/3653705/10.jpg" /> <img src="http://stackoverflow.com/questions/3653705/11.jpg" /> <img src="http://stackoverflow.com/questions/3653705/12.jpg" /> </div><div class="container"><img src="http://stackoverflow.com/questions/3653705/13.jpg" /> <img src="http://stackoverflow.com/questions/3653705/14.jpg" /> <img src="http://stackoverflow.com/questions/3653705/15.jpg" /> <img src="http://stackoverflow.com/questions/3653705/16.jpg" /> <img src="http://stackoverflow.com/questions/3653705/17.jpg" /> <img src="http://stackoverflow.com/questions/3653705/18.jpg" /> <img src="http://stackoverflow.com/questions/3653705/19.jpg" /> <img src="http://stackoverflow.com/questions/3653705/20.jpg" /> <img src="http://stackoverflow.com/questions/3653705/21.jpg" /> <img src="http://stackoverflow.com/questions/3653705/22.jpg" /> <img src="http://stackoverflow.com/questions/3653705/23.jpg" /> <img src="http://stackoverflow.com/questions/3653705/24.jpg" /> </div>\[/code\]etc...Any Ideas??Thanks so much!!!
 
Back
Top