All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
计算两者相差几个月零几天_[PHP教程]

Writer: 归海一刀 Article type: Programming skills(编程技巧) Time: 2014/2/10 6:56:03 Browse times: 424 Comment times: 0

计算两者相差几个月零几天_[PHP教程]


Head photo

Go homepage
Upload pictures
Write articles

计算两者相差几个月零几天_[PHP教程]

function diff(date, date1 = "now")
{
time = strtotime(date);
y = date("Y", time);
m = date("m", time);
d = date("d", time);

time1 = strtotime(date1);
_y = date("Y", time1);
_m = date("m", time1);
_d = date("d", time1);

if (y == _y)
{
m1 = m - _m;
}
else
{
m1 = m + (12 - _m);
}

if (d >= _d)
{
d1 = d - _d;
}
else
{
m1 --;
t1 = date("t");
d1 = d + (t1 - _d);
}

return m1 . "月零" . d1 . "天";
}





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.