Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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>
Comment

PREVIOUS NEXT
Code Example
Php :: php group array by value and count 
Php :: subdomain in laravel and xampp 
Php :: php check if class exists 
Php :: laravel collection put 
Php :: ternary expressions php 
Php :: laravel validation unique email except self 
Php :: WooCommerce cart API php 
Php :: reset array keys php 
Php :: Woocommerce remove add to cart message 
Php :: how validate the value of object in arraye in laravel 
Php :: big int php 
Php :: if else if ternary php 
Php :: timestamp php 
Php :: laravel carbon 
Php :: laravel create model and migration 
Php :: mcrypt php extension required 
Php :: php continue 
Php :: php read mysql 
Php :: php no such file or directory 
Php :: how to create laravel project 
Php :: php static dropdown list example 
Php :: php number format comma and decimal 
Php :: gd php extension 
Php :: how to fetch all column values php 
Php :: make project in laravel 7 
Php :: increase php memory 
Php :: yii2 jquery head 
Php :: php unlink 
Php :: laravel database seeder medium 
Php :: comments in php 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =