例子,php获取每月第一天与最后一天。
php日期函数 date用法。
- function getthemonth($date)
- {
- $firstday = date('y-m-01', strtotime($date));
- $lastday = date('y-m-d', strtotime("$firstday +1 month -1 day"));
- return array($firstday,$lastday);
- }
- $today = date("y-m-d");
- $day=getthemonth($today);
- ?>
|