Author: Sergey Panteleev (saundefined)
Committer: Derick Rethans (derickr)
Date: 2025-08-12T14:29:29+01:00

Commit: 
https://github.com/php/web-php/commit/65e043c50e6c9330890aa22152197444e5eacf3d
Raw diff: 
https://github.com/php/web-php/commit/65e043c50e6c9330890aa22152197444e5eacf3d.diff

Fix selection for usage

Changed paths:
  M  downloads.php


Diff:

diff --git a/downloads.php b/downloads.php
index 6b8d3f46e8..99d2a0cf09 100644
--- a/downloads.php
+++ b/downloads.php
@@ -96,7 +96,9 @@ function option(string $value, string $desc, $attributes = 
[]): string
         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>

Reply via email to