PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I've the following code, there is an error but I can't quite figure it out. If someone see something wrong with the code, please shed some light. Thanks...
P.S. I think the error is around the string $suffix.
<?
$startHourOfWeekPlanner = 8; // Start hour of week planner
$endHourOfWeekPlanner = 21; // End hour of weekplanner.
$date = mktime($startHourOfWeekPlanner,0,0,5,5,2006);
for($no=$startHourOfWeekPlanner;$no<=$endHourOfWeekPlanner;$no++){
$hour = $no;
// Remove these two lines in case you want to show hours like 08:00 - 23:00
$suffix = date("a",$date);
$hour = date("g",$date);
// $suffix = "00"; // Enable this line in case you want to show hours like 08:00 - 23:00
$time = $hour."<span class=\"content_hour\">$suffix</span>";
$date = $date + 3600;
?>
<div class="calendarContentTime"><? echo $time; ?></div>
<?
}
?>
<?
$startHourOfWeekPlanner = 8; // Start hour of week planner
$endHourOfWeekPlanner = 21; // End hour of weekplanner.
$date = mktime($startHourOfWeekPlanner,0,0,5,5,2006);
for($no=$startHourOfWeekPlanner;$no<=$endHourOfWeekPlanner;$no++){
$hour = $no;
// Remove these two lines in case you want to show hours like 08:00 - 23:00
$suffix = date("a",$date);
$hour = date("g",$date);
// $suffix = "00"; // Enable this line in case you want to show hours like 08:00 - 23:00
$time = $hour."<span class='content_hour'>$suffix</span>";
$date = $date + 3600;
?>
<div class="calendarContentTime"><? echo $time; ?></div>
<?
}
?>
<?
$startHourOfWeekPlanner = 8; // Start hour of week planner
$endHourOfWeekPlanner = 21; // End hour of weekplanner.
$date = mktime($startHourOfWeekPlanner,0,0,5,5,2006);
for($no=$startHourOfWeekPlanner;$no<=$endHourOfWeekPlanner;$no++){
$hour = $no;
// Remove these two lines in case you want to show hours like 08:00 - 23:00
$suffix = date("a",$date);
$hour = date("g",$date);
// $suffix = "00"; // Enable this line in case you want to show hours like 08:00 - 23:00
$time = $hour."<span class='content_hour'>$suffix</span>";
$date = $date + 3600;
?>
<div class="calendarContentTime"><? echo $time; ?></div>
<?
}
?>
Humm, I don't know what's going on here. I downloaded WAMP and installed on my local computer and run this script from there. I don't know if there is anything that causes this to not work. If anyone else know anything please post some tips. Thanks...