← All built-ins / checkdate()
checkdate()
checkdate(...$args): bool
Parameters
| Name | Type | Description |
|---|---|---|
| $month | int | 1–12 |
| $day | int | 1–31 |
| $year | int | 4-digit year |
Return value
true when the date exists (knows leap years).
Example
var_dump(checkdate(2, 29, 2024)); var_dump(checkdate(2, 29, 2023)); var_dump(checkdate(13, 1, 2024));
bool(true) bool(false) bool(false)