Home >Backend Development >PHP Tutorial >php gets the number of days in the month at the specified time

php gets the number of days in the month at the specified time

WBOY
WBOYOriginal
2016-07-25 09:09:421880browse
php gets the number of days in the month at the specified time
  1. $days = cal_days_in_month(CAL_GREGORIAN, 4, 2011);
  2. echo "Return the number of days in 2011-4".$days."
    ";
  3. $days = date( 't', strtotime("2011-4-1"));
  4. echo "Return the number of days in 2011-4".$days."
    ";
  5. $days = date("t");
  6. echo "The number of days in the current month".$days."
    ";
  7. ?>
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP ProxyNext article:PHP Proxy