How can the strtotime function be used to calculate future dates in PHP?

To calculate future dates using the strtotime function in PHP, you can simply pass a future date string as the first parameter to strtotime along with the current date as the second parameter. This function will return a timestamp representing the future date. You can then format this timestamp using the date function to display it in the desired format.

$currentDate = date("Y-m-d");
$futureDate = date("Y-m-d", strtotime("+1 week", strtotime($currentDate)));
echo "Future Date: " . $futureDate;