示例#1
0
function age($params, &$smarty)
{
    $d = new Duration();
    $d->short();
    $d->terse();
    $a = $d->AgeAsArray(ceil($d->Diff(time(), $params["time"])));
    if (isset($params['steps'])) {
        return join(' ', array_slice($a, 0, $params['steps']));
    }
    return join(' ', $a);
}