date and more php issue
-
Hi there…..
I wish to have a select box with all the last 24 months.I did on my own in php and html on some other page and form but now i wish to add the same in some cf7 forms
How can I implement something like that using contact form?
`<?php
function mesi_anno() {
$mese = array (“Gennaio-“, “Febbraio-“, “Marzo-“, “Aprile-“, “Maggio-“, “Giugno-“, “Luglio-“, “Agosto-“, “Settembre-“, “Ottobre-“, “Novembre-“, “Dicembre-“);
$giorno = array (“Domenica”, “Lunedì”, “Martedì”, “Mercoledì”, “Giovedì”, “Venerdì”,”Sabato”);
$str=””;
for($i = 0; $i < 24; $i++) {
$time = mktime(0, 0, 0, date(‘n’) – $i);
$str .=”<option value=”.$mese[(date(“n”, $time)-1)].date(“Y”, $time).”>”.$mese[(date(“n”, $time)-1)].date(“Y”, $time).”</option>”;
}
return $str;
}echo ‘<select name=”quando”>’.mesi_anno().'</select>’
?>
- The topic ‘date and more php issue’ is closed to new replies.