PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $shows = [ 1 => [ 12 => 'Closed', 1012 => 'Open', 1002 => 'The Fred and Lucy Hour' ], /*** each day shows array ***/ 7 => [ 0 => 'Sunday good show', 6 => 'The Hymn Hour' ] ]; $weekday = date('N'); $hour = date('H'); $now_plaing = 'Default show'; foreach($shows[$weekday] as $h=>$show) { if ($h <= $hour) $now_plaing = $show; } printf("Now Playing: %s", $now_plaing);
Show:  
Copy Clear