For Subtract 1 week use this code:
Please replace your date with ‘2012-12-12‘.
$first_date = strtotime('2012-12-12'); $second_date = strtotime('-7 day', $first_date); print 'First Date ' . date('Y-m-d', $first_date); print 'Next Date ' . date('Y-m-d', $second_date);
You Can Also Use This Code for Subtract 1 Week:
Please replace your date with ‘2012-12-12‘.
echo date('Y-m-d', strtotime('-7 day', strtotime('2012-12-12')));