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
Release: 2016-07-25 09:09:42
Original
1877 people have browsed it
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


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template