Home › Forums › Back End › Remember Dropdown Selection › Re: Remember Dropdown Selection
November 17, 2010 at 7:13 am
#74780
Rob MacKay
Participant
Just to look at your original code – you can use a shorthand if/else like this…
and the second part – remember to close your first option tag – personally I like to build a var and echo it. You can also use number_format to set how you want your number to float.
$arOptions = array('100', '250', '500', '1000');
foreach ($arOptions as $value){
$e = "
$e .= ($value == $_GET) ? " selected " : "";
$e .= ">£" . number_format($value, 2, '.', ''); . "";
echo $e;
}