wkilc Posted August 16, 2014 Share Posted August 16, 2014 Hi, I want to set two expiration dates in a form. Prior to the fall deadline, options A, B, C are displayed. After the fall date has passed, only A and B will be displayed. This works beautifully: <?php //SET THE TIME ZONE date_default_timezone_set('America/New_York'); //CREATE TIMESTAMP VARIABLES $current_ts = time(); $fall_deadline_ts = mktime(0,0,0,9,1,2014); $winter_deadline_ts = mktime(0,0,0,12,1,2014); //IF THE FALL DEADLINE HAS PASSED if($current_ts > $fall_deadline_ts) { echo "a, b"; } else { echo "a, b ,c"; } ?> How can I tweak this so that after the Winter deadline has ALSO passed, it will only display A, rather than A, B? Thanks! Quote Link to comment Share on other sites More sharing options...
Solution fastsol Posted August 16, 2014 Solution Share Posted August 16, 2014 if($current_ts > $winter_deadline_ts){ echo "a"; } elseif($current_ts > $fall_deadline_ts) { echo "a, b"; } else { echo "a, b ,c"; } Quote Link to comment Share on other sites More sharing options...
wkilc Posted August 16, 2014 Author Share Posted August 16, 2014 Brilliant! Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.