Hello and thanks for any help. Here is what I am trying to do. I am working on a radio station website. I am building an 'On Air Now' function to be used on the website. What I have is this....
function phpblock_onair ()
{
$now = date("H i s");
$day = date("D");
if ($now > ("06 00 00")& $now < ("10 00 00"))
{
if ( $day == "Sat" )
{
$display = "sat";
}
else
if ( $day == "Sun" )
{
$display = "Sun";
}
else
{
$display = "
<table align='center' border='0'>
<tr>
<td><center>
STUFF HERE <center></td>
</tr>
</table>
";
}
Basically, they have regular shifts during the weekday....but the times and shifts are different on Sat and Sun. For example, the morning show is weekdays 6a-10a, but on Sat there is something at 6-7am and something else at 7-9....than the schedule changes on Sunday.
So, I am wondering how I can simplify this function.....so I can config the if statement to simply say....
If it is mon-fri from 6a-10a do this. If it is Sat frm 6a-7a do this.....if it is sun 6p-10p do this....etc,
How can my function be rebuilt to do the above?
Thanks