1 2 3 4 5 6 7 8 9 10 11
<?php $allowed = array (15, 28); // List here all the non % 10 value you want to print for($i=10; $i<=50; $i++) { if ($i % 10 === 0) { echo $i."\n"; } else if (in_array($i, $allowed)) { echo $i."\n"; } } ?>
1 2 3 4 5 6 7
10 15 20 28 30 40 50