Intervelopment Posted August 21, 2009 Share Posted August 21, 2009 Hey All, Im writing a small website and i have some text at the top of the page that says 'Listen 9pm - 1am Every Friday Night' What i want to do is change the text to 'Listen Now' between 9pm and 1am every friday night. I cant seem to figure out how to do it. It would be great if someone could give me a hand Thanks Muchly Quote Link to comment https://forums.phpfreaks.com/topic/171260-change-text-if-falls-in-certain-time-period/ Share on other sites More sharing options...
Daniel0 Posted August 21, 2009 Share Posted August 21, 2009 This should do it. if (date('N') == 5 && date('H') >= 21 || date('N') == 6 && date('H') <= 1) { echo 'Listen Now'; } else { echo 'Listen 9pm - 1am Every Friday Night'; } Quote Link to comment https://forums.phpfreaks.com/topic/171260-change-text-if-falls-in-certain-time-period/#findComment-903094 Share on other sites More sharing options...
Intervelopment Posted August 21, 2009 Author Share Posted August 21, 2009 Beautiful ... Thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/171260-change-text-if-falls-in-certain-time-period/#findComment-903106 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.