Je veux afficher les dates des jours respectifs du mois en particulier. Comment puis-je le faire? Je parviens seulement à entrer le mois et montrer toutes les dates.Comment puis-je obtenir les jours du mois en utilisant php?
<html>
<body>
<form method="POST">
Day (Eg: Sunday) : <input name="day" required type="text" size="30" style="height:30px;" /> <br/><br/>
Month (Eg: 7) : <input name="month" required type="text" size="30" style="height:30px;" /> <br/><br/>
<input name="Submit" type="submit" value="Log In" style="background-color: #2E9AFE; border: 1px solid #084B8A; padding: 1px 3px; color:#fff; width:60px; height:30px;" />
</form>
<?php
\t $day=$_POST['day'];
\t $month=$_POST['month'];
\t
function getDates($y, $m)
\t {
\t \t return new DatePeriod(
\t \t \t new DateTime("first sunday of $y-$m"),
\t \t \t DateInterval::createFromDateString('next sunday'),
\t \t \t new DateTime("last day of $y-$m")
\t \t);
\t }
\t foreach (getDates(2015, $month) as $getDay) {
\t \t echo $getDay->format("l, Y-m-d\n");
\t }
\t
?>
</body>
</html>
Vous souhaitez afficher tous les jours du mois donné? –
oui ~ comme je veux juste afficher tout le lundi d'août ... tu sais comment le faire? – wendy