<?php

for ($i = 0; $i < 10; ++$i) {
    $targetDivNumber = ($i % 3) + 1;
    echo "Item #".($i + 1)." goes into div$targetDivNumber\n";
}