Robson » Code » PHP » Fuzzy Clock Short

// fuzzy clock short v1.0
// this is my attempt at creating a fuzzy clock with the smallest number of characters.
// function and call are just for convienience, the actual code is between the comments
function ic_fuzzy_clock($s=0)
// start
$b=explode('|',$x[$h].'|five|ten|quarter|twenty|twenty five|half|twenty five|twenty|quarter|ten|five|'.$x[$h+1]);
return !$m||$m==12?$t:($m>6?$t.' to '.$x[$h+1]:$t.' past '.$x[$h]);
// end
echo ic_fuzzy_clock();
© 2004-17 robson | cc unless stated