Download
<?php
$fruits = array('Orange' => 'O',
'Banane' => 'B',
'Pomme' => 'P',
'Fraise' => 'F');
print '
<select name="sweet">';
foreach ($fruits as $option => $label) {
print '
<option value="' .$option .'"';
// Sélectionner l''option pomme
if ($option == 'Pomme') {
print ' selected="selected"';
}
print "> $label</option>
";
}
print '</select>
';
?> |
<?php
$fruits = array('Orange' => 'O',
'Banane' => 'B',
'Pomme' => 'P',
'Fraise' => 'F');
print '
<select name="sweet">';
foreach ($fruits as $option => $label) {
print '
<option value="' .$option .'"';
// Sélectionner l''option pomme
if ($option == 'Pomme') {
print ' selected="selected"';
}
print "> $label</option>
";
}
print '</select>
';
?>