- round: documentation ( source)
- range: documentation ( source)
<?php
$step = 5;
$usernumber = 18;
$myseries = range(0, 59, $step);
$myseries = range(0, 59, 5);
foreach($myseries as $num) {
echo $num.'<br />';
$check = round($usernumber/$step) * $step;
echo "<br>".$check."--";
//if($usernumber is close to $num) {
// echo 'Matching number is '.$num;
//}
}