I'm trying to use PHP to find out which alternate week (A or B) today's date falls into and then output something for A and something for B.
Here's an example of a Monday A and B output but I can't figure out how to find out out which one is in the next seven days and output a different message based on that (this week is Monday A, for example):
<?php
$MonAstart = new DateTime( '2018-01-01' );
$MonAend = new DateTime( '2018-12-24' );
$MonBstart = new DateTime( '2018-01-08' );
$MonBend = new DateTime( '2018-12-24' );
$interval = new DateInterval('P2W');
$interval = DateInterval::createFromDateString('2 weeks');
$periodMonA = new DatePeriod($MonAstart, $interval, $MonAend);
$periodMonB = new DatePeriod($MonBstart, $interval, $MonBend);
?>
<h2>Monday A</h2>
<?php
foreach ( $periodMonA as $dt )
echo $dt->format( "d/m/Y " );
?>
<h2>Monday B</h2>
<?php
foreach ( $periodMonB as $dt )
echo $dt->format( "d/m/Y " );
?>