1
2
3
4
5
6
<?php
function lot($n, $m) {
   $a = range(1, $n);
   shuffle($a);
   return array_slice($a, -$m);
}