79448987

Date: 2025-02-18 16:36:21
Score: 0.5
Natty:
Report link

Here is my take on it:

function formatTime($seconds){
    $result=[];
    $lbl=['d','h','m','s'];
foreach([86400,3600,60,1] as $i=>$dr){
    $next=floor($seconds/$dr);
    $seconds%=$dr;
    if($next>0)$result[]="$next$lbl[$i]";
}
    return implode(' ',$result);
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Ziarek