首页 > PHP > php 获取指定时间所在月份的天数

php 获取指定时间所在月份的天数

<?php
$days = cal_days_in_month(CAL_GREGORIAN, 7, 2011);
echo “返回2011-7的天数 “.$days.”<br/>”;
$days = date(‘t’, strtotime(“2011-7-1”));
echo “返回2011-7的天数 “.$days.”<br/>”;
$days = date(“t”);
echo “当前月的天数 “.$days.”<br/>”;
?>

  1. 还没有评论。
  1. No trackbacks yet.

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: