I have the following php function below:
function showComboHorarios($name, $default = '08:00') {
$hi = 6; // hora inicial
$hf = 23; // hora final
?>
<select style="width: 80px;" name="<?php echo $name; ?>">
<?php
for ($i = $hi; $i <= $hf; $i++) {
$h = ($i < 10) ? '0' . $i : $i;
$h .= ':';
?>
<option value="<?php echo $h . '00'; ?>"<?php echo ($default == $h . '00') ? ' selected' : ''; ?>><?php echo $h . '00'; ?></option>
<option value="<?php echo $h . '30'; ?>"<?php echo ($default == $h . '30') ? ' selected' : ''; ?>><?php echo $h . '30'; ?></option>
<?php
}
?>
</select>
<?php
}
and then displays the screen:
However,I'mtryingtoinsertaminutebyminuteinthesamefunction:
functionshowComboHorarios($name,$default='08:00'){$hi=6;//horainicial$hf=23;//horafinal?><selectstyle="width: 80px;" name="<?php echo $name; ?>">
<?php
for ($i = $hi; $i <= $hf; $i++) {
$h = ($i < 10) ? '0' . $i : $i;
$h .= ':';
for ($min = 0; $min< 59; $min++){
?>
<option value="<?php echo $h . $min ?>"<?php echo ($default == $h . $min ) ? ' selected' : ''; ?>><?php echo $h . $min ?></option>
<option value="<?php echo $h . $min ?>"<?php echo ($default == $h . $min) ? ' selected' : ''; ?>><?php echo $h . $min; ?></option>
<?php
}//for mminuto
}
?>
</select>
<?php
}
however, the screen displays like this:
How do I leave the 00:00 format?
Thank you for your attention.