1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Fix selection for usage

This commit is contained in:
Sergey Panteleev
2025-07-03 14:31:44 +03:00
committed by Derick Rethans
parent 0dd651c0bc
commit 65e043c50e

View File

@@ -96,7 +96,9 @@ if (!array_key_exists('osvariant', $options) || !array_key_exists($options['osva
I want to use PHP for
<select id="usage" name="usage">
<?php foreach ($usage as $value => $description) { ?>
<?= option($value, $description); ?>
<?= option($value, $description, [
'selected' => array_key_exists('usage', $options) && $options['usage'] === $value,
]); ?>
<?php } ?>
</select>.
</div>