Easy enough:
<?php
function decclock($time, $clock = 24) {
return ((int)$time % $clock) . ':' . (($time * 60) % 60);
}
echo decclock(2.5);
?>
Basically, the idea is that in 2.5, 2 is the number of hours since the start of the day, and 0.5 is the number of hours since the start of the hour.
So to obtain the hour portion of your clock format, we just need to typecast to int and take the result modulo 24 (or 12, if you're using a 12 hour clock).
To obtain the minutes portion, we multiply by the number of minutes in an hour (i.e. 60), then take the result modulo 60.