On Tue, July 31, 2007 6:10 am, Hulf wrote: > for ($value = 0; $value <= 2000; $value += 100) { > > echo "<option value=\"$value\" if ($min_rent==$value) {echo > selected="selected" }> $value</option>"; You could slap a ?: tertiary operator in there: echo "<option value=\"$value\", ($min_rent==$value ? 'selected="selected"' : ''), "\"> $value</option>"; but it might be a bit less cluttered to do: $selected = $min_rent == $value ? 'selected="selected"' :''; echo "<option value=\"$value\" $selected>$value</option>\n"; -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php