php function to get dates of last 7 weeks

grantmint

New Member
I am trying to build a php function that would return an array with the start date and end date of the last n number of weeks. this would include the current week. It would look something like this:\[code\]function lastnweeks(n){//the code. I am not asking for the code itself but ideas on how to accomplish thisreturn $array; }$lastnweeks =lastnweeks(2);print_r($lastnweeks);\[/code\]this would print:\[code\]Array ( [0] => Array ( [0] => 2010/09/20 [1] => 2010/09/26 )[1] => Array ( [0] => 2010/09/13 [1] => 2010/09/19))\[/code\]
 
Back
Top