<select class="form-control" name="presence_visa" id="presenceVisa">
<?php switch ($order["visa"]): case "0": ?>
<option value="0"
data-value="<?= lang("unspecified") ?>" selected="selected"><?= lang("unspecified") ?></option>
<?php break; ?>
<?php case "1": ?>
<option value="1"
data-value="<?= lang("there_visa") ?>" selected="selected"><?= lang("there_visa") ?></option>
<?php break; ?>
<?php case "2": ?>
<option value="2"
data-value="<?= lang("no_visa") ?>" selected="selected"><?= lang("no_visa") ?>
</option>
<?php break; ?>
<?php case "3": ?>
<option value="3"
data-value="<?= lang("no_visa_my") ?>" selected="selected"><?= lang("no_visa_my") ?>
</option>
<?php break; ?>
<?php case "4": ?>
<option value="4"
data-value="<?= lang("need_not") ?>" selected="selected"><?= lang("need_not") ?></option>
<?php break; ?>
<?php endswitch; ?>
</select>
$selectValues = [
['value' => 0, 'title' => lang('unspecified')],
['value' => 1, 'title' => lang('there_visa')],
['value' => 2, 'title' => lang('no_visa')],
['value' => 3, 'title' => lang('no_visa_my')],
['value' => 4, 'title' => lang('need_not')],
]
<select class="form-control" name="presence_visa" id="presenceVisa">
<?php foreach ($selectValues as $option) { ?>
<option <?php if ($order['visa'] == $option['value']) { ?>selected="selected"<?php } ?> value="<?= $option['value'] ?>" data-value="<?= $option['title'] ?>"><?= $option['title']?></option>
<?php } ?>
</select>