PHP Time - How do I combine it into an if statement?

Lewis

New member
I want to make a website for a radio station and I want to show whos on air at what time it is currently - For example

if (time = 5pm-7pm & day=monday) {
echo "DJ X (On between 5pm-7pm)";
else if (time = 7pm-9pm & day=monday) {
echo "DJ X (On between 7pm-9pm)";

and so on and so on

Thanks in advance
 
If you have access to a DB, I would suggest that you store a schedule in the DB and then perform then necessary query to get the data you need.

If you do not a switch statement would work better for this situation.

You also may want to use a multideminsonal array that stores the dj's info plus time. Loop the array and find what you are looking for.
 
Back
Top