测试测试

测试测试

20 3 月, 2025 阅读 33 字数 0 评论 1 喜欢 0

‘year’, ‘个月’=>’month’, ‘周’=>’week’, ‘天’=>’day’,
‘小时’=>’hour’, ‘分钟’=>’minute’, ‘秒’=>’second’
);

foreach ( $unitArr as $cn => $u )
{
if ( $$u > 0 )
{
$elapse = $$u . $cn;
break;
}
}

return $elapse;
}

$past = 2052345678; // Some timestamp in the past
$now = time(); // Current timestamp
$diff = $now – $past;

echo ‘发表于’ . time2Units($diff) . ‘前’;
?>

评论列表

  1. 哈哈哈哈哈说道:

    哈哈哈哈哈哈哈哈哈哈

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

问蝶  © CopyRight 2014-2025