public function getSecondsAsTextExtended($seconds)
    {
        $seconds = floatval($seconds);
        $result = [];

        $steps = [
            'days'    => 86400,
            'hours'   => 3600,
            'minutes' => 60,
            'seconds' => 1,
        ];

        foreach ($steps as $stepName => $stepDivider) {
            $stepCount = floor($seconds / $stepDivider);
            if (0 < $stepCount) {
                $result[] = sprintf('%d %s', $stepCount, $this->getTranslator()->transChoice($stepName, $stepCount));
                $seconds = $seconds - ($stepCount * $stepDivider);
            }
        }

        return implode(' ', $result);
    }
public function getSecondsAsTextExtended($seconds)
    {
        $seconds = floatval($seconds);
        $result = [];

        $steps = [
            'days'    => 86400,
            'hours'   => 3600,
            'minutes' => 60,
            'seconds' => 1,
        ];

        foreach ($steps as $stepName => $stepDivider) {
            $stepCount = floor($seconds / $stepDivider);
            if (0 < $stepCount) {
                $result[] = sprintf('%d %s', $stepCount, $this->getTranslator()->transChoice($stepName, $stepCount));
                $seconds = $seconds - ($stepCount * $stepDivider);
            }
        }

        return implode(' ', $result);
    }
public function getSecondsAsTextExtended ( $ seconds ) { $ seconds = floatval ( $ seconds ) ; $ result = [ ] ; $ steps = [ 'days' => 86400 , 'hours' => 3600 , 'minutes' => 60 , 'seconds' => 1 , ] ; foreach ( $ steps as $ stepName => $ stepDivider ) { $ stepCount = floor ( $ seconds / $ stepDivider ) ; if ( 0 < $ stepCount ) { $ result [ ] = sprintf ( '%d %s' , $ stepCount , $ this -> getTranslator ( ) -> transChoice ( $ stepName , $ stepCount ) ) ; $ seconds = $ seconds - ( $ stepCount * $ stepDivider ) ; } } return implode ( ' ' , $ result ) ; }
Get Seconds As Text Extended

@param float $seconds

@return string
Get Seconds As Text Extended