[web-php] master: Fix selection for usage

From: Date: Tue, 12 Aug 2025 13:36:25 +0000
Subject: [web-php] master: Fix selection for usage
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-33094@lists.php.net to get a copy of this message
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>

« previous php.webmaster (#33094) next »