php echo selected option

Solutions on MaxInterview for php echo selected option by the best coders in the world

showing results for - "php echo selected option"
Stella
10 Jan 2019
1<select name="s" size="20">
2  <option value="402" <?php if ($_GET['s'] == '402') { echo 'selected'; } ?>>Audi</option>
3  <option value="74" <?php if ($_GET['s'] == '74') { echo 'selected'; } ?>>BMW</option>
4  <option value="201" <?php if ($_GET['s'] == '201') { echo 'selected'; } ?>>Ford</option>
5  <option value="35" <?php if ($_GET['s'] == '35') { echo 'selected'; } ?>>Saab</option>
6</select>
7