Hi everyone
Sunday question here very PHP-oriented. I try to exclude some arrays from other arrays, but some of them are dates, other are normal ones, so I’m a bit lost.
=> Some ‘Monday’ and ‘Tuesday’ have ‘inactive’ class instead of ‘fmoon’
=> Some ‘Monday’ and ‘Tuesday’ have ‘inactive’ class and I don’t want to.
<?php
if(date('D', strtotime($day)) === 'Mon' || date('D', strtotime($day)) === 'Tue' ) { echo 'id="ferie" ';} <== exclude class="fmoon" from here
elseif (in_array($day, $ferie)) { echo 'id="ferie" ';}
elseif (in_array($day, $fmoon)) { echo 'id="fmoon"';}
if($day->month() != $month) echo ' class="inactive"' <== exclude 'Mon' and 'Tue' from here
?>
I think the way to do that is using array diff if I’m right, but manipulating dates and arrays is very mystical for me.