我有问题在php找到开始日期和月份和年份的结束日期,当我知道年和月?
例如:
input - > year = 2011 , month = 08
output -> start date = 01 , end date = 31
Run Code Online (Sandbox Code Playgroud)
Ros*_*ena 28
echo date('m-01-Y 00:00:00',strtotime('this month')) . '<br/>';
echo date('m-t-Y 12:59:59',strtotime('this month')) . '<br/>';
Run Code Online (Sandbox Code Playgroud)
开始日期始终为1,您可以使用以下功能查找结束日期
cal_days_in_month(CAL_GREGORIAN, $month, $year);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
25005 次 |
| 最近记录: |