What are common methods in PHP to check if a date is in the future or past?

To check if a date is in the future or past in PHP, you can use the `DateTime` class to create DateTime objects for the given date and the current date. Then, you can compare these DateTime objects to determine if the date is in the future or the past.

$date = new DateTime('2023-12-31');
$currentDate = new DateTime();

if ($date > $currentDate) {
    echo 'The date is in the future.';
} elseif ($date < $currentDate) {
    echo 'The date is in the past.';
} else {
    echo 'The date is today.';
}