Generate function for date by loop in form
<?php
function generateOptions($start,$end,$inc){
$options = '';
for($i=$start; $i<=$end; $i+=$inc){
$options = $options.'<option>'.$i.'</option>';
}
return $options;
}
?>
<select>
<option>Day</option>
<?php echo generateOptions(1,31,1); ?>
</select>
function generateOptions($start,$end,$inc){
$options = '';
for($i=$start; $i<=$end; $i+=$inc){
$options = $options.'<option>'.$i.'</option>';
}
return $options;
}
?>
<select>
<option>Day</option>
<?php echo generateOptions(1,31,1); ?>
</select>
Comments
Post a Comment