hi leute,
wie kann ich mit dem Ilch template system den inhalt eines arrays in eine dropdown box ausgeben?
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
<? // Array contents $array2 = array('s'=>'Sydney','m'=>'Melbourne','b'=>'Brisbane','T'=>'Tasmania','a'=>'Adelaide','p'=>'Perth','d'=>'Darwin','t'=>'ACT'); // Values from array 2 echo'<select name="cities">'; // For each key of the array assign variable name "cityid" // For each value of the array assign variable name "city". foreach($array2 as $cityid=>$city){ echo'<option value="'.$cityid.'">'.$city.'</option>'; } echo'</select>'; ?>
Geschlossen | ||
![]() |
Zurück zu HTML, PHP, SQL,... |