3v4l.org

run code in 300+ PHP versions simultaneously
<?php header("Content-Type: text/plain; charset=utf-8"); mb_internal_encoding('utf-8'); $total = []; $skip = 5; For ($i=1; $i<31; $i++){ $total[$i-1]=$i; } $schet=0; while (count($total)>= $skip) { foreach ($total as $key => $value) { $schet+=1; If ($schet==5) { unset($total[$key]); $schet=0; } } } echo "Выигрышные места: "; foreach ($total as $key => $value) { echo "$value, "; } ?>

preferences:
80.76 ms | 405 KiB | 5 Q