Siggles Posted December 6, 2007 Share Posted December 6, 2007 <?php $now = date('Y-m-d'); if ($now > date('2007-12-06') AND $now < date('2007-12-09')) { echo "Luton (A)<br /> Saturday, 8 December 2007"; } elseif($now > date('2007-12-09') AND $now < date('2007-15-09')) { echo "Oldham (H)<br /> Saturday, 15 December 2007"; }else { echo "End of season"; } ?> I got this short script working with the unix timestamp but it was too long to edit so have tried to change it to just using the date as above but now it goes striaght to the last else. Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 6, 2007 Share Posted December 6, 2007 use the strtotime function instead <?php $now = time(); if ($now > strtotime('2007-12-06') AND $now < strtotime('2007-12-09')) { echo "Luton (A) Saturday, 8 December 2007"; } elseif($now > strtotime('2007-12-09') AND $now < strtotime('2007-15-09')) { echo "Oldham (H) Saturday, 15 December 2007"; } else { echo "End of season"; } ?> Quote Link to comment Share on other sites More sharing options...
Siggles Posted December 6, 2007 Author Share Posted December 6, 2007 Great stuff. thanks! 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.