<?php
$j=0;
for ($i=0; $i<2; $i++){
$hour = 9;
$correct = 13;
$a = $hour;
$a = ereg_replace("0([0-9]+)", "\1", $a);
$b = $correct;
while ($a <= $b){
$room108[$j] = $a++;
echo "\n";
$j++;
}
}
$c_arr = array_count_values($room108);
$header_array = array("1am"=>"1", "2am"=>"2", "3am"=>"3", "4am"=>"4", "5am"=>"5", "6am"=>"6", "7am"=>"7", "8am"=>"8", "9am"=>"9", "10am"=>"10", "11am"=>"11", "12Noon"=>"12", "13"=>"13" );
foreach($header_array as $x=>$y){
if(array_key_exists($y,$c_arr){
print $x . " " . $c_arr[$y]."<BR>";
}else{
print $x ." --<BR>";
}
}
?>
The above php coding is giving the error
It is showing this error after foreach
Parse error: parse error, unexpected '{' in /home/rooms/htdocs/statistics/while.php on line 26