$date = "2022-03-05"; // Subtract 7 days from the date echo date("Y-m-d", strtotime($date . "-7 days"));