<?php $n = 3;$m = 2; $i = $n - 1;do { $d = $i % 7 + 1; echo $d . ' '; $i++;} while($d != $m);
Standard input is empty
3 4 5 6 7 1 2
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!