lundi 29 août 2016

calendar start on saturday php

i'm creating a calendar in php, but i can't start it on the saturday, i mean i would like a table who begin the saturday and finish the friday. i'm stuck :(

echo "<table class='table tableDisplay".$currentMonthNumber." table-bordered '>";
echo "<tr>
    <td>Saturday</td>
    <td>Sunday</td>
    <td>Monday</td>
    <td>Tuesday</td>
    <td>Wednesday</td>
    <td>Thursday</td>
    <td>Friday</td>
</tr><tr>";
for ($i=1; $i <= $nbOfDaysInCurrentMonth ; $i++) {
    $p = date('w', mktime(0,0,0, $calendrier_date_mois, $i, $calendrier_date_annee));

    if($p == 5){
        echo "</tr><tr>";
    }
    echo "<td>".$i."</td>";
}
echo "</table>";




Aucun commentaire:

Enregistrer un commentaire