<?php $array = array(1, 2, 3, 4); $count = sizeof($array); for ($i = 0; $i < 7; $i++) { $key = ($i % $count); echo $array[$key], "<br />\n"; } ?>