I have a foreach statement in my app that echos a list of my database results:
foreach
If the $featured_projects array is based on incremental index you could simply use the index and the modulo % operator.
$featured_projects
Otherwise you would have to add a counter.
http://php.net/manual/en/language.operators.arithmetic.php