Skip to content

Commit 23b1eb6

Browse files
committed
Fix selection for usage
1 parent ba53c4e commit 23b1eb6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

downloads.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ function option(string $value, string $desc, $attributes = []): string
9696
I want to use PHP for
9797
<select id="usage" name="usage">
9898
<?php foreach ($usage as $value => $description) { ?>
99-
<?= option($value, $description); ?>
99+
<?= option($value, $description, [
100+
'selected' => array_key_exists('usage', $options) && $options['usage'] === $value,
101+
]); ?>
100102
<?php } ?>
101103
</select>.
102104
</div>

0 commit comments

Comments
 (0)