Are there any built-in PHP functions that can be used to validate dates more effectively than regular expressions?

When validating dates in PHP, it is more effective to use built-in functions like `strtotime()` or `DateTime::createFromFormat()` instead of regular expressions. These functions can parse a wide range of date formats and handle edge cases more reliably.

$date = '2022-12-31';
if (strtotime($date) !== false) {
    echo "Valid date";
} else {
    echo "Invalid date";
}