Returns
selected="selected" string if the parameter values are equal.
Use this function for programming OPTION elements inside SELECT tag.
The following code creates a select element for selecting a country state.
<select>
<? foreach ($states as $state): ?>
<option <?= option_state($current_state, $state->id) ?> value="<?= h($state->id) ?>"><?= h($state->name) ?></option>
<? endforeach ?>
</select>