halo guys. now im trying to create dropdown date in PHP code with displaying multiplies 2 or 3 of date. i give example :
start date today = 2019/01/11
display drop down for multiplies 2 with max display 4
<select name="date">
<option value="2019/01/13">13 Jan</option>
<option value="2019/01/15">15 Jan</option>
<option value="2019/01/17">17 Jan</option>
<option value="2019/01/19">19 Jan</option>
</select>
or
display drop down for multiplies 3 with max display 3
<select name="date">
<option value="2019/01/14">14 Jan</option>
<option value="2019/01/17">17 Jan</option>
<option value="2019/01/20">20 Jan</option>
</select>
is this posible?
<select>
<?php
$today = date('Y-m-d');
$date=date_create($today);
for($i = 1; $i < 10; $i++){
date_add($date,date_interval_create_from_date_string("2 days")); ?>
<option value='<?= date_format($date,"Y/m/d") ?>'><?= date_format($date,"d M") ?></option><?php
} ?>
</select>
The above code will take the current date and display the next 10 dates multiplies by 2. If you want to display more dates just change the condition in for loop