php humanized display time

巴扎黑
Release: 2016-11-22 16:52:07
Original
1444 people have browsed it

函 // Time conversion function (display time humanization)

function transf ($ time) {
$ rtime = date ("m-d h: i", $ time);
$ htime = date ("h: i" . 60 * 60)
                                                             $min = floor($time/60); *60); 60*24)); If($d==1)
$str = 'yesterday'.$rtime;
else
$str = 'the day before yesterday'.$rtime;
}else
{ time ;
}
return $str;
}
$times=time()-254;
echo tranTime($times);

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template