php - Want to add dates for week -
I am using this code in the code in It works well, but this functionality is to be added: and want to create an array holding all +1 weeks between these dates. How can I do this? Here's a way to do this: You can view one week :
$ date1 = "2009-10-11"; $ D = new date time ($ 1 date); $ D- & gt; Modify ('+1 week'); Echo $ d- & gt; Format ('YMD'), "\ n";
$ startDate = "2009-10-11"; $ EndDate = "2010-01-20";
$ startDate = "2009-10-11"; $ EndDate = "2010-01-20"; $ Dates = array (); $ Temp = strtotime ($ startDate); Do {$ dates [] = Date ("Y-M-D", $ temp); $ Temp = strtotime ("+ 1 week", $ temp); } While ($ temp & lt; strtotime ($ endDate)); Print_r ($ DAYS);
Comments
Post a Comment