Copy 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 = "一";
break;
case '2':
$week = "二";
break;
case ' 3':
$week = "三";
break;
case '4':
$week = "四";
break;
case '5':
$week = "five";
break;
case '6':
$week = "six";
break;
}
Return $week;
}
http://www.bkjia.com/PHPjc/320400.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/320400.htmlTechArticleCopy 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...