I have the following variables:
$semana = $_POST['semana'];
list($part1, $part2) = explode('_', $semana);
$fecha_7_dias = date("d-m-Y",strtotime($part1."+ 6 days"));
$week: 07-01-2019_02-2019
$part1: 07-01-2019
$date_7_days: 01-13-2019
$part2: 02-2019
I get the date from Monday to Sunday of the week "02-2019" but now I need to show the dates of the previous week "01-2019" which would be between 12-31-2018 and 01-06-2019
You create the variable like this:
and then you can put that date in the format you want:
And you already have the date a week before.