运维网's Archiver
论坛
›
php
› php相隔算天数
asdrtu
发表于 2017-3-22 10:42:42
php相隔算天数
<?php
function getDay($day){
return abs(strtotime($day) - strtotime(date("Y-m-d")))/86400;
}
echo getDay('2012-5-10');
?>
strtotime — 将任何英文文本的日期时间描述解析为 Unix 时间戳
页:
[1]
查看完整版本:
php相隔算天数