PHP 获得几个月的日子
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP 获得几个月的日子相关的知识,希望对你有一定的参考价值。
<?
function getMonthDays($Month, $Year)
{
//Si la extensión que mencioné está instalada, usamos esa.
if( is_callable("cal_days_in_month"))
{
return cal_days_in_month(CAL_GREGORIAN, $Month, $Year);
}
else
{
//Lo hacemos a mi manera.
return date("d",mktime(0,0,0,$Month+1,0,$Year));
}
}
//Obtenemos la cantidad de dÃas que tiene septiembre del 2008
echo getMonthDays(9, 2008);
?>
以上是关于PHP 获得几个月的日子的主要内容,如果未能解决你的问题,请参考以下文章