- reset: documentation ( source)
- explode: documentation ( source)
- sort: documentation ( source)
<?php
$string = '614
602
613
601
617
605
619
607
615
603
678
594
703
701
697
695
677
593
702
699
696
693
650
647
649
646
648
645';
$string = explode("\n", $string);
reset($string);
sort($string);
reset($string);
foreach($string as $x) {
echo 'case ' . $x . ':' . "\n";
}