<?php ini_set('display_errors', 1); error_reporting(-1); function nom_jour($date) { $jour_semaine = array(1=>"Lundi", 2=>"Mardi", 3=>"Mercredi", 4=>"Jeudi", 5=>"Vendredi", 6=>"Samedi", 7=>"Dimanche"); list($annee, $mois, $jour) = explode ("-", $date); $timestamp = mktime(0,0,0, $mois, $jour, $annee); $njour = date("N", $timestamp); return $jour_semaine[$njour]; } echo 'jour : ['.nom_jour('2009-12-07').']'; ?>
$timestamp mktime(0,0,0, date($mois), date($jour), date($annee));
echo $jour_semaine[$njour];
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question[code=php]Strict Standards: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '1.0/no DST' instead in E:\_Environnement\bureau\QuisortLeSite\test.php on line 10 Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '1.0/no DST' instead in E:\_Environnement\bureau\QuisortLeSite\test.php on line 11 jour : [Lundi]/code
Notice: Undefined index: N in /homez.218/quisort/www/test.php on line 12 jour : []