Answers for "php echo selected option"

PHP
0

php echo selected option

<select name="s" size="20">
  <option value="402" <?php if ($_GET['s'] == '402') { echo 'selected'; } ?>>Audi</option>
  <option value="74" <?php if ($_GET['s'] == '74') { echo 'selected'; } ?>>BMW</option>
  <option value="201" <?php if ($_GET['s'] == '201') { echo 'selected'; } ?>>Ford</option>
  <option value="35" <?php if ($_GET['s'] == '35') { echo 'selected'; } ?>>Saab</option>
</select>
Posted by: Guest on May-03-2021

Browse Popular Code Answers by Language