Determine si la hora actual es el primer día de cada mes

hora de función pública ()
{

$today = date("Y-m-d");
$day = $this->getthemonth($today);
if ($day[0] == $day[1]) {
    return True;
} else {
    return False;
}

}
función getthemonth ($ fecha)
{ firstday = date (′ Y - m - 0 1 ′, strtotime (firstday = date ('Ym-01', strtotime (
f i r s t d a y=d un t e (Y-metro-0 1 ,s t r t o t i m e ( fecha));
hoy día = fecha (′ Y - m - d ′, hora de inicio (hora actual = fecha ('Ym-d', hora de inicio (n o w d una y=d un t e (Y-metro-D ,s t r t o t i m e ( fecha));
lastday = date (′ Y - m - d ′, strtotime ("lastday = date ('Ym-d', strtotime ("l a s t d a y=d un t e (Y-metro-D ,s t r t o t i m e ( " primer día +1 mes -1 día"));
matriz de retorno ($ primer día, $ hoy, $ último día);
}

Supongo que te gusta

Origin blog.csdn.net/weixin_43784997/article/details/115292939
Recomendado
Clasificación