How can relative expressions be used to manipulate dates in PHP?

Relative expressions in PHP can be used to manipulate dates by adding or subtracting a specific time interval from a given date. This can be useful for tasks such as calculating future or past dates, determining the difference between two dates, or formatting dates in a specific way. Relative expressions like "+1 day", "-2 weeks", or "+1 month" can be used with functions like strtotime() or date_add() to perform date calculations efficiently.

// Example of manipulating dates using relative expressions
$today = date('Y-m-d');
$nextWeek = date('Y-m-d', strtotime('+1 week'));
$nextMonth = date('Y-m-d', strtotime('+1 month'));

echo "Today: $today\n";
echo "Next week: $nextWeek\n";
echo "Next month: $nextMonth\n";