is there anyone who can help me with this problem (new to php)
I am using the following code to generate the current day and 8 weeks previous
$date = date('Y-m-d');
$weeks = 9;
for ($i = 0; $i < $weeks; ++$i) {
echo $date . "<br />";
list($year, $month, $day) = explode('-', $date);
$time = mktime(0, 0, 0, $month, $day, $year);
$time = strtotime('- 1 week', $time);
$date = date('Y-m-d', $time);
}
//data returned is
2008-08-30
2008-08-23
2008-08-16
2008-08-09
2008-08-02
2008-07-26
2008-07-19
2008-07-12
2008-07-05
but I need to store each line as a variable to use im my sql query....any ideas??