Copy the code The code is as follows:
// Get the number of days in a certain month, which can be used in any month
function getDays($month, $year)
{
switch($month)
{
case 4:
case 6:
case 9:
case 11:
$days = 30;
break;
case 2:
if ($year%4==0)
{
if ($year 0==0)
{
$ days = $year@0==0 ? 29 : 28;
}
else
{
$days =29;
}
}
else
{
$days = 28;
}
break;
default:
$ days = 31;
break;
}
return $days;
}
**
* Get the corresponding day of the week based on the timestamp
*
* @param int $time_stamp timestamp
*/
function getWeek($time_stamp)
{
$week_num = date("w",$time_stamp);
switch($week_num)
{
case "0":
$week = "day";
break;
case '1':
$week
case '4':
$ week = "four";
break;
case '5':
$week = "five";
break;
case '6':
$week = "six";
break;
}
Return $week;
}
The above introduces the code of Bandari Childhood PHP to obtain the number of days between the Rui year and the normal year, including the content of Bandari Childhood. I hope it will be helpful to friends who are interested in PHP tutorials.