$value) { if ($string >= $value) { $nb = floor($string / $value); // add a zero before seconds or minutes with just one digit if $long == false $nb = (! $long && ! empty($result) && ($output[$i] == 'minute' || $output[$i] == 'second') && strlen($nb) == 1) ? 0 . $nb : $nb; $s = ($nb == 1) ? $output[$i] : $outputs[$i]; $s = $long ? " $s" : substr($s, 0, 1); $string = $string % $value; $result[] = "$nb$s"; } } return implode(' ', $result); }