<p>1.获取某个月的总天数。</p><pre>echo date("t",strtotime("2018-2")); //28,获取2018年2月的总天数</pre><p><br></p><p>2.判断某天是星期几,或是不是星期六。</p><pre>echo date("w", strtotime("2018-10-06")); //6, 星期六<br>echo date("w", strtotime("2018-10-07")); //0, 星期天</pre><blockquote><p>记住就星期天特殊,由0表示,其它都是对应的。<br></p></blockquote><p>3.获取上个月的时间、获取上个月第一天和最后一天</p><p>获取上个月:</p><p><br></p><p><br></p><p>一周之后: strtotime("+1 week");<br>一周之前: strtotime("-1 week");<br>一月之后: strtotime("+1 months");<br>一天之后: strtotime("+1 days"); <br>30秒之后 strtotime( " +30 seconds");<br>20分钟之后 strtotime( " +20 minutes ");<br>12个小时之后 strtotime( " +12 hours ");<br></p>