What are some potential pitfalls when using the strtotime function in PHP to calculate weeks?

One potential pitfall when using the strtotime function in PHP to calculate weeks is that it may not always give accurate results, especially when dealing with edge cases like leap years or daylight saving time changes. To solve this issue, it's recommended to use the DateTime class, which provides more reliable date and time calculations.

$date = new DateTime();
$date->modify('+1 week');
echo $date->format('Y-m-d');