I have the following code that is working perfectly, but I need the results inside the $arrayDiasSemestre
to be '1' for the monday, '2' for the tuesday and so on ...
$inicio = new DateTime($start_date);
$fim = new DateTime($end_date);
$fim->modify('+1 day');
$interval = new DateInterval('P1D');
$periodo = new DatePeriod($inicio, $interval ,$fim);
foreach($periodo as $data){
$arrayDiasSemestre[] = $data->format("l");
}
How could I change this input at the time of filling the array ? Would anyone know of any way to do this?