- round: documentation ( source)
- in_array: documentation ( source)
- max: documentation ( source)
- range: documentation ( source)
<?php
$step = 5;
$usernumber = 188;
$myseries = range(0, 59, $step);
$myseries = range(0, 59, 5);
$check = round($usernumber/$step) * $step;
echo "<br>".$check;
if(in_array($check,$myseries))
echo "\n".$check;
else
echo max($myseries);