PHP之日期获取月首月尾(YYYY-MM)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP之日期获取月首月尾(YYYY-MM)相关的知识,希望对你有一定的参考价值。
public function strtotime_date($time) { $time = explode(‘-‘, $time); $year = $time[0]; $month = $time[1]; $beginDate = date(‘Y-m-01‘, strtotime("$year-$month")); $endDate = date(‘Y-m-d‘, strtotime("$beginDate +1 month -1 day")); print_r($beginDate.‘||‘.$endDate); }
本文出自 “为了以后” 博客,谢绝转载!
以上是关于PHP之日期获取月首月尾(YYYY-MM)的主要内容,如果未能解决你的问题,请参考以下文章