3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $today=date("D"); $time1=strtotime("now"); $time2=strtotime("11:59pm"); //echo date('m-d-Y',strtotime("next Thursday")); //echo $today; if ($today=="Tue" || $today=="Wed" ) { $day1="Friday ".date('m-d-Y',strtotime("next Friday")); $day2="Tuesday ".date('m-d-Y',strtotime("next Tuesday")); if ($today=="Tue") $day3="Wednesday ".date('m-d-Y',strtotime("+1 week 1 days")); else $day3="Wednesday ".date('m-d-Y',strtotime("next Wednesday")); $day4="Thursday ".date('m-d-Y',strtotime("next Thursday")); } else if ($today=="Sun" || $today=="Mon" ) { $day1="Wednesday ".date('m-d-Y',strtotime("next Wednesday")); $day2="Thursday ".date('m-d-Y',strtotime("next Thursday")); $day3="Friday ".date('m-d-Y',strtotime("next Friday")); if ($today=="Sun") $day4="Tuesday ".date('m-d-Y',strtotime("+1 week 2 days")); else $day4="Tuesday ".date('m-d-Y',strtotime("+1 week 1 days")); } else if ($today=="Thu" || $today=="Fri" || $today=="Sat" ) { $day1="Tuesday ".date('m-d-Y',strtotime("next Tuesday")); $day2="Wednesday ".date('m-d-Y',strtotime("next Wednesday")); if ($today=="Thu") { $day3="Thursday ".date('m-d-Y',strtotime("+1 week ")); $day4="Friday ".date('m-d-Y',strtotime("+1 week 1 days")); } else { $day3="Thursday ".date('m-d-Y',strtotime("next Thursday")); $day4="Friday ".date('m-d-Y',strtotime("next Friday")); } } ?> <input type="radio" name="deliveryday" value="Deliver order on <?=$day1; ?>" checked><?php echo $day1;?><br /> <input type="radio" name="deliveryday" value="Deliver order on <?=$day2; ?>"><?php echo $day2;?><br /> <input type="radio" name="deliveryday" value="Deliver order on <?=$day3; ?>"><?php echo $day3;?><br /> <input type="radio" name="deliveryday" value="Deliver order on <?=$day4; ?>"><?php echo $day4;?>
Output for 5.4.0 - 7.2.0
<input type="radio" name="deliveryday" value="Deliver order on Tuesday 01-14-2014" checked>Tuesday 01-14-2014<br /> <input type="radio" name="deliveryday" value="Deliver order on Wednesday 01-15-2014">Wednesday 01-15-2014<br /> <input type="radio" name="deliveryday" value="Deliver order on Thursday 01-16-2014">Thursday 01-16-2014<br /> <input type="radio" name="deliveryday" value="Deliver order on Friday 01-17-2014">Friday 01-17-2014
Output for 5.1.0 - 5.3.29
<input type="radio" name="deliveryday" value="Deliver order on <?=$day1; ?>" checked>Tuesday 01-14-2014<br /> <input type="radio" name="deliveryday" value="Deliver order on <?=$day2; ?>">Wednesday 01-15-2014<br /> <input type="radio" name="deliveryday" value="Deliver order on <?=$day3; ?>">Thursday 01-16-2014<br /> <input type="radio" name="deliveryday" value="Deliver order on <?=$day4; ?>">Friday 01-17-2014
Output for 4.4.0 - 4.4.9, 5.0.5
<input type="radio" name="deliveryday" value="Deliver order on <?=$day1; ?>" checked>Tuesday 01-14-2014<br /> <input type="radio" name="deliveryday" value="Deliver order on <?=$day2; ?>">Wednesday 01-15-2014<br /> <input type="radio" name="deliveryday" value="Deliver order on <?=$day3; ?>">Thursday 01-16-2014<br /> <input type="radio" name="deliveryday" value="Deliver order on <?=$day4; ?>">Friday 01-10-2014
Output for 4.3.0 - 4.3.11, 5.0.0 - 5.0.4
<input type="radio" name="deliveryday" value="Deliver order on <?=$day1; ?>" checked>Tuesday 01-21-2014<br /> <input type="radio" name="deliveryday" value="Deliver order on <?=$day2; ?>">Wednesday 01-22-2014<br /> <input type="radio" name="deliveryday" value="Deliver order on <?=$day3; ?>">Thursday 01-23-2014<br /> <input type="radio" name="deliveryday" value="Deliver order on <?=$day4; ?>">Friday 01-17-2014