在下面的函数中,可能的输出可能
1 day and 2 hours and 34 minutes
我的问题是如何编辑内爆以便输出
1 day, 2 houts and 34 minutes
这是我的功能
function time_difference($endtime){
$hours = (int)date("G",$endtime);
$mins = (int)date("i",$endtime);
// join the values
$diff = implode(' and ', $diff);
if (($hours == 0 ) && ($mins == 0)) {
$diff = "few seconds ago";
}
return $diff;
}