Hi! I'm a complete n00b when it comes to PHP and I've been trying to figure this out for hours and hours and hours... Please help. I beg of you! //create "Select Bathrooms" $SelectBathrooms = "<select name=bathrooms>\n\t<option value=\"\"></option>\n\t"; for($r = '0'; $r <= '10'; $r++) { if($ap[bathrooms] == $r) { $SelectBathrooms .= "<option value=\"$r\" selected>$r</option>\n\t"; } else { $SelectBathrooms .= "<option value=\"$r\">$r</option>\n\t"; } } $SelectBathrooms .= "</select>\n"; I've scoured the internet in search for how to put more variables. As it is now, it shows 1-10 as stated in the function, but I need to put .5, 1.5, 2.5, etc. If there's anybody out there that can help us~ <3 Thank you!
You just need to increment your variable by 0.5 as opposed to 1. for($r = 0; $r <= 10.5; $r += 0.5) PHP: