How can the modify method be utilized in conjunction with the DateTime class to adjust dates in PHP?

To adjust dates using the DateTime class in PHP, you can utilize the modify method. This method allows you to add or subtract time intervals to a DateTime object, effectively adjusting the date and time. By specifying a modification string, you can easily manipulate dates in various ways, such as adding days, hours, or months.

$date = new DateTime('2022-01-15');
$date->modify('+1 week');
echo $date->format('Y-m-d'); // Output: 2022-01-22