public function seconds($seconds, $options = [])
    {
        // Seconds.
        if ($seconds < 60) {
            $time = $seconds;
            $name = 'second';
        }

        // Minutes.
        if ($seconds >= 60) {
            $time = round($seconds / 60, 0);
            $name = 'minute';
        }

        // Hours.
        if ($time >= 60) {
            $time = round($time / 60, 0);
            $name = 'hour';
        }

        // Days.
        if ($time >= 24) {
            $time = round($time / 24, 0);
            $name = 'day';
        }

        if (array_has($options, 'abbrev')) {
            switch ($name) {
                case 'second':
                    $name = 'sec';
                    break;
                case 'minute':
                    $name = 'min';
                    break;
            }
        }

        if (array_has($options, 'single')) {
            $name = substr($name, 0, 1);
        }

        if ($time == 1) {
            $time = '';
            $period = $name;
        } else {
            $period = str_plural($name, $time);
        }

        return sprintf('%s %s', $time, $period);
    }
public function seconds($seconds, $options = [])
    {
        // Seconds.
        if ($seconds < 60) {
            $time = $seconds;
            $name = 'second';
        }

        // Minutes.
        if ($seconds >= 60) {
            $time = round($seconds / 60, 0);
            $name = 'minute';
        }

        // Hours.
        if ($time >= 60) {
            $time = round($time / 60, 0);
            $name = 'hour';
        }

        // Days.
        if ($time >= 24) {
            $time = round($time / 24, 0);
            $name = 'day';
        }

        if (array_has($options, 'abbrev')) {
            switch ($name) {
                case 'second':
                    $name = 'sec';
                    break;
                case 'minute':
                    $name = 'min';
                    break;
            }
        }

        if (array_has($options, 'single')) {
            $name = substr($name, 0, 1);
        }

        if ($time == 1) {
            $time = '';
            $period = $name;
        } else {
            $period = str_plural($name, $time);
        }

        return sprintf('%s %s', $time, $period);
    }
public function seconds ( $ seconds , $ options = [ ] ) { // Seconds. if ( $ seconds < 60 ) { $ time = $ seconds ; $ name = 'second' ; } // Minutes. if ( $ seconds >= 60 ) { $ time = round ( $ seconds / 60 , 0 ) ; $ name = 'minute' ; } // Hours. if ( $ time >= 60 ) { $ time = round ( $ time / 60 , 0 ) ; $ name = 'hour' ; } // Days. if ( $ time >= 24 ) { $ time = round ( $ time / 24 , 0 ) ; $ name = 'day' ; } if ( array_has ( $ options , 'abbrev' ) ) { switch ( $ name ) { case 'second' : $ name = 'sec' ; break ; case 'minute' : $ name = 'min' ; break ; } } if ( array_has ( $ options , 'single' ) ) { $ name = substr ( $ name , 0 , 1 ) ; } if ( $ time == 1 ) { $ time = '' ; $ period = $ name ; } else { $ period = str_plural ( $ name , $ time ) ; } return sprintf ( '%s %s' , $ time , $ period ) ; }
Convert seconds to words.

@param int   $seconds
@param array $options

@return string
Convert seconds to words .