Skip to content

Instantly share code, notes, and snippets.

@emulsion-io
Created December 22, 2013 11:23
Show Gist options
  • Save emulsion-io/8081070 to your computer and use it in GitHub Desktop.
Save emulsion-io/8081070 to your computer and use it in GitHub Desktop.
Créer les select html pour heure et minute
<div class="form-group">
<label for="f_nom_arret">Heure de passage normal : </label>
<select name="heure">
<option value="h">heure</option>
<?php for ($heure = 00 ; $heure <= 23 ; $heure++):
$hour = sprintf("%02d", $heure);
?>
<option value="<?php echo $hour ?>"><?=$hour;?></option>
<?php endfor; ?>
</select>
<select name="minutes">
<option value="min">minutes</option>
<?php for ($minutes = 00 ; $minutes <= 59 ; $minutes++):
$min = sprintf("%02d", $minutes);
?>
<option value="<?=$min ?>"><?=$min;?></option>
<?php endfor; ?>
</select>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment