Funkce PHP checkdate().
Příklad
Zkontrolujte, zda je několik dat platných gregoriánských dat:
<?php
var_dump(checkdate(12,31,-400));
echo "<br>";
var_dump(checkdate(2,29,2003));
echo "<br>";
var_dump(checkdate(2,29,2004));
?>
Definice a použití
Funkce checkdate() se používá k ověření gregoriánského data.
Syntax
checkdate(month, day, year)
Hodnoty parametrů
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 |
Technické údaje
Návratová hodnota: | PRAVDA, pokud je datum platné. V opačném případě NEPRAVDA |
---|---|
Verze PHP: | 4,0+ |
❮ Reference data/času PHP