$arr = array(1,2,3,4,5,6,7,8,9,10,11); foreach ($arr as $val){ switch ($val){ case 3: echo '<font color="red">'.$val.'</font><br>'; ;break; case 5: echo '<font color="red">'.$val.'</font><br>'; ;break; default: echo $val.'<br>';break; } }