<?php $max = 130; $output = []; $current = 0; while($current <= $max) { if ($current < 100) { $current += 5; } else { $current += 25; } // Make sure we do not add anything above the current max (e.g. max = 120, current = 110 + 25 = 135) if ($current > $max) { break; } $output[] = $current; } print_r($output);
You have javascript disabled. You will not be able to edit any code.