so i got this script for the moment :
<select class="n-select" name="heure-event" id="heure-event">
<option selected="selected"></option>
<?php
for ( $heures = 0 ; $heures <= 23 ; $heures++ ){
for ( $minutes = 0 ; $minutes <= 45 ; $minutes += 15 ){
?>
<option value="<?php echo $heures.':'.$minutes;?>:00">
<?php
echo $heures.':'.$minutes;
?>
</option>
<?php
}
}
?>
</select>
It works very well, but the little problem : 1:15
, 1:0
, etc.
I want: 01:15
and 1:00
.
Can somebody help me? I need probably to check if $i
is < 10
then add '0.$i'
or something like this?