Timeout using Continue?

I want to print out a list times from 10 am to 2 pm in 10 minute increments. I wish to exclude 11:00-11:30 am from this list. This line causes the script to time out…

if ($compare <= '11:00 AM' || $compare >= '11:30 AM') {continue;}

Here’s what I have so far:


<?php
$start = "11:40";  //first session$end = "13:10"; //last session$increments = '10'; //minutes between posted times.
$tStart = strtotime($start);$tEnd = strtotime($end);
$tNow = $tStart;

//select from database and put id's into an array.  If not in array then print out form field.

$i=1;while($tNow <= $tEnd){              
 $compare = date("h:i A",$tNow);
if ($compare <= '12:30 PM' || $compare >= '12:55 PM') {continue;}   
echo date("h:i A",$tNow)." <br>\
";  ?>

<div>  <input name="studid" type="text" size="20" maxlength="8" />  <input name="resid" type="hidden" value="<?php echo $i; ?>" />  <input name="submit" type="button" value="Reserve" /></div>

<?php  $tNow = strtotime("+$increments minutes",$tNow);  $i++;
} //end while
?>

Any solutions to prevent the time out and exclude the times?

Thanks in advance,

Tim

I think it timesout because you do not update the value of $tNow and $tEnd inside your while loop, so your loop never ends.
You should probably increase your $tNow inside the loop by 10 minutes.