How can PHP be used to add a specific number of days to a given date input in a specified format?

To add a specific number of days to a given date input in a specified format using PHP, you can use the `date()` and `strtotime()` functions. First, convert the given date input into a timestamp using `strtotime()`, then add the desired number of days using `strtotime('+X days', $timestamp)`. Finally, format the resulting timestamp using `date()` with the specified format.

$dateInput = '2022-01-15';
$daysToAdd = 7;
$dateTimestamp = strtotime($dateInput);
$newDateTimestamp = strtotime('+' . $daysToAdd . ' days', $dateTimestamp);
$newDate = date('Y-m-d', $newDateTimestamp);

echo $newDate; // Output: 2022-01-22