php获取当月的第一天以及最后一天

<?php
header("Content-Type:text/html;charset=utf-8");
$date = date("Y-m-d H:i:s",time());
$firstday = date("Y-m-01",strtotime($date));
$lastday = date("Y-m-d",strtotime("$firstday +1 month -1 day"));

var_dump($firstday,$lastday);
?>

 

posted @ 2016-02-03 09:59  侠岚之弋痕夕  阅读(148)  评论(0编辑  收藏  举报
Where is the starting point, we don't have a choice, but the destination where we can pursue!