Home >Backend Development >PHP Tutorial >PHP time rubbing conversion remaining time

PHP time rubbing conversion remaining time

不言
不言Original
2018-04-17 16:19:331843browse

The content of this article is about the remaining time of PHP time conversion, which has a certain reference value. Now I share it with everyone. Friends in need can refer to it

// 天数
$day = floor($times/86400);
// 小时
$hour = floor(($times-86400 * $day)/3600);
// 分钟
$minute = floor(($times-86400 * $day-3600 * $hour)/60);
return $day.'天'.$hour.'小时'.$minute.'分钟';

Related recommendations:

Detailed explanation of PHP timestamp function

The above is the detailed content of PHP time rubbing conversion remaining time. For more information, please follow other related articles on the PHP Chinese website!

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