note 114552 added to function.mktime

From: Date: Wed, 05 Mar 2014 20:01:30 +0000
Subject: note 114552 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-198804@lists.php.net to get a copy of this message
this function returns the number of days of a provided month and year, it consider the actual rules for leap years (if the year is multiple of 4 which is not a multiple of 100 unless multiple of thousand then is a leap) Regards, hope this function solves any issue :) function daysinmonth($month,$year) { $dim = 0; switch ($month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: $dim=31; break; case 4: case 6: case 9: case 11: $dim=30; break; case 2: if($year%4==0) { if($year%100==0) { if($year%1000==0) { $dim=29; } else { $dim=28; } } else { $dim=29; } } else {$dim=28;} break; } return($dim); } ---- Server IP: 72.52.91.14 Probable Submitter: 72.52.91.14 ---- Manual Page -- http://php.net/manual/en/function.mktime.php Edit -- https://master.php.net/note/edit/114552 Del: integrated -- https://master.php.net/note/delete/114552/integrated Del: useless -- https://master.php.net/note/delete/114552/useless Del: bad code -- https://master.php.net/note/delete/114552/bad+code Del: spam -- https://master.php.net/note/delete/114552/spam Del: non-english -- https://master.php.net/note/delete/114552/non-english Del: in docs -- https://master.php.net/note/delete/114552/in+docs Del: other reasons-- https://master.php.net/note/delete/114552 Reject -- https://master.php.net/note/reject/114552 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#198804) next »