<?php
$total = 15;
$skip = 5;
$char = 0;
$array = range(1, $total); while (count($array) >= $skip) { foreach ($array as $key => $value) {
$char += 1;
if ($char == $skip) {
$char = 0;
}
}
}
PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKJHRvdGFsID0gMTU7CiRza2lwICA9IDU7CiRhcnJheSA9IGFycmF5KCk7CiRjaGFyID0gMDsKCiRhcnJheSA9IHJhbmdlKDEsICR0b3RhbCk7CndoaWxlIChjb3VudCgkYXJyYXkpID49ICRza2lwKSB7CmZvcmVhY2ggKCRhcnJheSBhcyAka2V5ID0+ICR2YWx1ZSkgeyAKCSRjaGFyICs9IDE7CglpZiAoJGNoYXIgPT0gJHNraXApIHsKCQl1bnNldCgkYXJyYXlbJGtleV0pOwoJCSRjaGFyID0gMDsKCX0KfQp9CnZhcl9kdW1wKCRhcnJheSk7