Making massive comparisons with PHP
September 16, 2007 7:13 AM
Subscribe
PHP gurus - what's the most elegant way to display a variable bit of text on a website sidebar based on time-of-day and day-of-week?
Building a page that will show, in real time, what program is currently playing on a radio station. So on Sunday mornings between 7 and 8, it needs to display one string of text; from 8 to 10, something else, and so on.
I know I can do this with a massive series of if/then/else comparisons, but is there a better way? My reluctance to this approach comes from knowing that schedules change, and modifying this logic would be a pain.
posted by jbickers to computers & internet (8 comments total)
posted by SpecialK at 7:27 AM on September 16, 2007