I’ve made up a script for a music festival web site that will show who is onstage at the time that a user accesses the site. The script works fine so far, but I’m wondering if I could add an “Up Next” line somehow.
Can anyone help?
[php]<?php
date_default_timezone_set(“America/Menominee”);
$time_start = (date(‘mdYh:iA’));
$time_end = (date(‘mdYh:iA’));
// the date, start and end must be edited to test this script
$acts = array(
array(
‘name’ => ‘Band #1’,
‘stage’=> ‘Small’,
‘date’ => ‘06202011’,
‘start’ => ‘04:15PM’,
‘end’ => ‘04:20PM’
),
array(
‘name’ => ‘Band #2’,
‘stage’=> ‘Main’,
‘date’ => ‘06202011’,
‘start’ => ‘04:20PM’,
‘end’ => ‘04:25PM’
),
array(
‘name’ => ‘Band #3’,
‘stage’=> ‘Galactic’,
‘date’ => ‘06202011’,
‘start’ => ‘04:25PM’,
‘end’ => ‘04:40PM’
)
);
foreach ($acts as $act) {
foreach($act as $key => $value) {
if ($time_start = $act[‘date’].$act[‘start’] && $time_end < $act[‘date’].$act[‘end’]) {
echo $act[‘name’].’ is on the ‘.$act[‘stage’].’ Stage.’;
break;
}
}
}
?>[/php]