I'm trying to put the last 14 dates of the calender in a dropdown box. I thought you could just subtract a number from the date value, but I guess not. Can someone tell me how to get the last 14 dates into an array? The following doesn't work.
PHP Code:$myarr = array(0 => (date("n/j/Y")-14), (date("n/j/Y")-13), (date("n/j/Y")-12), (date("n/j/Y")-11), (date("n/j/Y")-10), (date("n/j/Y")-9), (date("n/j/Y")-8), (date("n/j/Y")-7), (date("n/j/Y")-6), (date("n/j/Y")-5), (date("n/j/Y")-4), (date("n/j/Y")-3), (date("n/j/Y")-2), (date("n/j/Y")-1), date("n/j/Y"));
$i=0;
for($i=0;$i<15;$i++)
echo $myarr[$i] . "<br>";




Reply With Quote