Forum Moderators: coopster
Its basically just a way to display a weeks calendar, from the current day, back 7 days....
not the first three variables, but the weekly days below..
$ts = time(); //current timestamp
$sdate = date("F j Y"); //start date
$edate = date("F j Y", ( $ts - $one_week)); //7 days ago
<!--this below is what i want to learn how to turn into an array-->
$one_week = 7 * 24 * 60 * 60; //seconds of 7 days ago
$six_days = 6 * 24 * 60 * 60; //seconds of 6 days ago
$five_days = 5 * 24 * 60 * 60; //etc.
$four_days = 4 * 24 * 60 * 60;
$three_days = 3 * 24 * 60 * 60;
$two_days = 2 * 24 * 60 * 60;
$one_day = 1 * 24 * 60 * 60;
]
$seconds_in_day = 24*60*60;
$times = [url=http://www.php.net/array]array[/url]();
for($i = 1; $i <= 7; $i++) {
$times[] = $i*$seconds_in_day;
}
echo '<pre>'; print_r($times); echo '</pre>';