使用php查找下一个15的日期 [英] Find the date for next 15th using php

查看:107
本文介绍了使用php查找下一个15的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找下一个15日的日期。
我发现这个获取日期下一次发生的第18次,但这显示了今天的日期,如果它的'18th ..我想看到20111年8月18日。

I am trying to find the date when it's next 15th. I came across this Get the date of the next occurrence of the 18th but this shows the today date if its' 18th..I want to see August 18th 20111.

有什么办法得到下一个15日?

Is there any way to get the next 15th?

推荐答案

                                   // dynamic typing FTW
$next15th = mktime(0, 0, 0, date('n') + (date('j') >= 15), 15);

echo date('Y-m-d', $next15th);

这篇关于使用php查找下一个15的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆