The number of days in the month where the php date is located_PHP tutorial

WBOY
Release: 2016-07-20 11:06:44
Original
1005 people have browsed it

php日期所在月的天数

 public function daysOfMonth ($year=NULL,$month=NULL) {
  if ($year===NULL) {
   $year = $this->getPart('yy');
  }
  if ($month===NULL) {
   $month = $this->getPart('mm');
  }
  if ($month==2)
  {
   if (($year % 4 == 0 && $year % 100 != 0) || $year %

400 == 0)
    $result = 29;
   else
    $result = 28;
  }
  elseif ($month == 4 || $month == 6 || $month == 9 || $month

== 11)
   $result = 30;
  else
   $result = 31;
  return $result;
 }


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/445010.htmlTechArticlephp日期所在月的天数 public function daysOfMonth ($year=NULL,$month=NULL) { if ($year===NULL) { $year = $this-getPart('yy'); } if ($month===NULL) { $month = $this-getPart('m...
Related labels:
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