Ok here is my issue I tried to use a Ternary operator and a switch break on my issue and still coming up with the same results.
Now Iam trying an ifelse to see if this works but Iam still getting the same error where it should be echoing out "is a P4" but instead it's stating that this is a P1
<?php
//************************************
//https://stackoverflow.com/questions/53180920/unix-time-stamp-adding- 2-weeks-4-weeks-6-weeks-8-weeks/53181428#53181428
//unix time stamp
//************************************
//1536079080 = 04-09-2018 (Day of the task)
//1541376000 = 11-06-2018 (todays date )
//1542758400 = 11-21-2018 (2 weeks and 1)
//************************************
// > Greater than
// < Less than
// >= Greater than or equal to
// <= Less than or equal to
//************************************
$mod = 1536079080; //unix time stamp
$moDate = new DateTime('@'. $mod, new DateTimeZone('America/Los_Angeles')); //Unix change to PST time
$today = date("d/m/Y"); //todays date
$twoWeeks = time() + (3600*24*14); //NOW + ( 3600 sec = 1 hour * 24 hours/day * 14 days)
$fourWeeks= time() + (3600*24*28);
$sixWeeks = time() + (3600*24*42);
$eightWeeks = time() + (3600*24*56);
// Less than or equal to and less than
$p1 = ($mod <= $twoWeeks && $mod < $fourWeeks)? true : false;
$res1 = ($p1) ? 'Is a P1' : 'Is not a P1'."<br>";
//Greater than or equal to and less then 6 weeks
$p2 = ($mod >= $fourWeeks && $mod < $sixWeeks)? true : false;
$res2 = ($p2) ? 'is a P2' : 'Is not a P2'."<br>";
//Greater than or equal to and less then 8 weeks
$p3 = ($mod >= $sixWeeks && $mod < $eightWeeks)? true : false;
$res3 = ($p3) ? 'Is a P3' : 'Is not a P3'."<br>";
// is equal to 8 weeks and greater then 8 weeks
$p4 = ($mod == $eightWeeks && $mode > $eightWeeks)? true : false;
$res4 = ($p4) ? 'Is a P4' : 'Is not a P4'."<br>";
echo $res1 , $res2, $res3, $res4;
//Output
//Is a P1
//Is not a P2
//Is not a P3
//Is not a P4
?>