0
Cet exemple utilise la librairie input de Kohana, mais le principe est applicable à n’importe quelle source de données.
// Saisie d'exemple : 25/12/2012
if ($this->input->post('startDate')) {
list($day, $month, $year) = preg_split('/\//', $this->input->post('startDate'));
var_dump(checkdate($month, $day, $year)); // bool(true)
echo $day; // 25
echo $month; // 12
echo $year; // 2012
}
DATE 31 Jan 2013










