What are some alternative methods for calculating the weekday index for future dates in PHP?

When calculating the weekday index for future dates in PHP, one alternative method is to use the `DateTime` class to create a date object for the future date and then use the `format` method with the 'N' format specifier to get the numeric representation of the day of the week (1 for Monday, 7 for Sunday).

// Create a DateTime object for a future date
$futureDate = new DateTime('2022-12-25');

// Get the numeric representation of the day of the week (1 for Monday, 7 for Sunday)
$weekdayIndex = $futureDate->format('N');

echo $weekdayIndex; // Output: 7