Ok, i just totally simplified it. I've got it narrowed to this:
Code:<?php $timeout4 = '17:00'; $inorout = 'out'; $x = 4; $it = 'time'.$inorout.$x; print $it; // works... prints timeout4 print "<br />"; print ${$it}; // also works... prints 17:00 if (${$it} == "17:00") print ${$it}; // WORKS. prints 17:00 //HERE is the problem. When $h hits 17, the if() should fire true. Well it doesn't and only prints the non-selected option for ($h = 6; $h <= 22; $h++) { if (${$it} == '$h:00') {$output = "<option value='$h:00' selected='selected'>$h:00</option>";} else { $output = "<option value='$h:00'>$h:00</option>"; } } echo $output;


Reply With Quote
Bookmarks