Funzione PHP checkdate()
Esempio
Controlla se più date sono date gregoriane valide:
<?php
var_dump(checkdate(12,31,-400));
echo "<br>";
var_dump(checkdate(2,29,2003));
echo "<br>";
var_dump(checkdate(2,29,2004));
?>
Definizione e utilizzo
La funzione checkdate() viene utilizzata per convalidare una data gregoriana.
Sintassi
checkdate(month, day, year)
Valori dei parametri
Parameter | Description |
---|---|
month | Required. Specifies the month as a number between 1 and 12 |
day | Required. Specifies the day as a number between 1 and 31 |
year | Required. Specifies the year as a number between 1 and 32767 |
Dettagli tecnici
Valore di ritorno: | VERO se la data è valida. FALSO altrimenti |
---|---|
Versione PHP: | 4.0+ |
❮ Riferimento di data/ora PHP