Hi everyone, I would like to save the contents of a for loop into an array, but the problem is that the variable needs to be styled into a date format first. Here is my code so far:
$arrive = '1574978400';
$depart = '1575064800';
for ( $i = $arrive; $i <= $depart; $i = $i + 86400 ) {
$bookedDates = date('Y-m-d', $i );
// needs to be output as an array ...
}
I will then compare the resulting dates (with the following example format: 2019-11-28) with a set of dates from another array using array_intersect.