Mega Code Archive

 
Categories / Php / Statement
 

Printing a select menu with while()

<? $i = 1; print '<select name="people">'; while ($i <= 10) {     print "<option>$i</option>\n";     $i++; } print '</select>'; ?>