2016-03-23 21 views

cevap

0

PHP'niz:

$mondayTimestamp = strtotime('monday this week'); 
$output = []; 
for ($day = 0; $day < 7; $day++) { 
    $output[] = date('d M y', strtotime(sprintf('+%d days', $day), $mondayTimestamp)); 
} 

HTML'iniz: bir düzine + sorulardan

<select name="days"> 
    <?php foreach ($output as $day) : ?> 
     <option value="<?php echo $day ?>"><?php echo $day ?></option> 
    <?php endforeach; ?> 
</select> 
+2

tarih-saat sınıfını kullanarak biraz daha seksi çalıştı. http://au2.php.net/manual/en/class.datetime.php –

İlgili konular