Home >Backend Development >PHP Tutorial >php humanized display time

php humanized display time

巴扎黑
巴扎黑Original
2016-11-22 16:52:071461browse

函 // 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);

Statement:
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
Previous article:PHP relative path problemNext article:PHP relative path problem