随笔-103  评论-37  文章-0  trackbacks-0
<?php
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);
?> 


 if ($_POST[date_begin] == '') $date_begin = date("Y-m-01", strtotime("-1 month"));
   else $date_begin = $_POST[date_begin];
   if ($_POST[date_end] == '') $date_end = date('Y-m-d', strtotime("$date_begin +1 month -1 day"));
   else $date_end = $_POST[date_end]; 

转自http://wystec.blog.163.com/blog/static/29614447201281232138198/ 
posted on 2013-03-24 21:52 鱼有所思 阅读(750) 评论(0)  编辑 收藏 引用 网摘 所属分类: PHP

只有注册用户登录后才能发表评论。
网站导航: