Actually Shryku's way doesn't work (at least no on my server) and won't ever work with floating point numbers however you can do this very simply with some modulous arithmetic. Here is the code, just copy and paste to test it out.
<?php
$number = 126;
$newNumber = substr($number, -1)."0";
$roundToTens = roundToTens($number);
$roundToNumber = roundToNumber($number,25);
displayOutput($number,$newNumber,$roundToTens,$roundToNumber);
function displayOutput($a,$b,$c,$d) {
echo "<p>Original Number: " . $a . "<br />\n";
echo "Shryku's Way: " . $b . "<br />\n";
echo "Round To Tens: " . $c . "<br />\n";
echo "Rount To 25: " . $d . "<br />\n";
}
function roundToTens($a) {
$a = intval($a);
return ($a - ($a%10));
}
function roundToNumber($a,$b) {
$a = intval($a);
return ($a - ($a%$b));
}
?>