Tuesday, August 4, 2009

PHP - Get a range of dates between two dates

function dateRangeArray($start, $end)
{
$range = array();

if (is_string($start) === true) $start = strtotime($start);
if (is_string($end) === true ) $end = strtotime($end);

do {
$range[] = date('Y-m-d', $start);
$start = strtotime("+ 1 day", $start);
} while($start <= $end);

return $range;
}

Credit: http://boonedocks.net/mike/archives/137-Creating-a-Date-Range-Array-with-PHP.html

22 comments:

Anonymous said...

This might be a bit off-topic but I believe there are a lot of smokers here on www.blogger.com. I have recently decided to find a good manufacturer of electronic cigarettes. I'm done with paying so much for normal smokes.A friend recommended [url=http://www.insanereleases.info/greensmokef.html]G Smoke[/url] According to their website this is how they described their product:
"Green Smoke offers supreme Electronic cigarettes with spendable cartridges that compose of the highest smoke volume in the industry. With a variety of flavors and nicotine levels, Green Smoke's™ patented technology offers convenience and performance that is unmatched. G Smoke products have been independently tested for safety."
I'm thinking of buying them. Anyone else have experience with this e-cigarette?

Anonymous said...

Excellent
the easiest of all possible
thanx a ton

Anonymous said...

Hello,
I have developed a new clean web 2.0 wordpress theme.

Has 2 colours silver and blue, has custom header(colour or image).
I am curently working on it, so if you have suggestions let me know.

You can view live demo and download from here www.getbelle.com
If you found bug reports or you have suggestions pm me.
Wish you a happing using.

many thanks to [url=http://www.usainstantpayday.com/]USAInstantPayDay.com[/url] for helping with hosting and developement of the theme
SetKneekNep

Anonymous said...

Extraordinary internet site.

SMOtop the Swedish seo consultant offering a wide range of seo services.
[url=http://www.smotop.se]SMOTop[/url]
http://www.smotop.se/smotopbloggen/

Anonymous said...

Hey there all fellow members i m kunal from kolkata we are specialised in providing largeness emailing services no spam shit
nothing else send emails anywhere u scarceness even we are providing emails options to Craiglist Emails !!

OOH yeah i m preferable u can email Craiglist @cl emails too with us !!

we dont get any spam conduct u can send emails to anywhere u miss u can forward anything u like !

we are giving exlusive 95% inbox Gurantee with our every Plans !!

We are having all types of plans for every an individual pls stop in at intervals :- [url=http://www.inbox-mailer.com]Out Spot Inbox Mailer Repayment for more details ![/url]


pre-eminent bulk [url=http://www.associatedcontentnetwork.com]email[/url] service,largest size email software,most dedicated server,most desirable dedicated servers,excellent email blast employ,superb email marketing,unsurpassed email newsletter professional care,noise email assistance,blast email services,blast emails,at the maximum correspondence,enlargement e post,mass e post marketing
largeness e despatch software,magnitude email,size email speak,mass email addresses,volume email advertising,magnitude email application,enlargement email applications,bulk email maximally,bulk email blasting,enlargement email broadcasting,enlargement email race,bulk email campaigns,bulk email client,enlargement email sorority,bulk email new zealand
bulk email the deity,enlargement email database,magnitude email transportation,enlargement email direct,volume email tell sender,volume email allocation,mass email extractor,bulk email fingerprint,largeness email forum,largeness email freeware,size email thick,volume email generator,size email guidelines,volume email hosting,volume email internet marketing,volume email liber veritatis
volume [url=http://www.inbox-mailer.com]email listings[/url],magnitude email lists,enlargement email dispatch,largeness email mailer,majority email mailing,[url=http://www.inbox-mailer.com]bulk email mailing[/url] laundry list,volume email management,size email director,magnitude email marketing,enlargement email marketing action,mass email marketing checking,enlargement email marketing services,majority email marketing software,magnitude email newsletter,mass email newsletters
majority email opt in,bulk email program,volume email programs

We are giving 95% + Inbox Guranteed No one-liner can beat out us !! Thanks a allotment !

Anonymous said...

hey all

I just wanted to introduce myself to everyone!

Can't wait to start some good conversations!

-Marshall

Thanks again!

viagra online said...

Hello friend amazing and very interesting blog about PHP - Get a range of dates between two dates

Anonymous said...

kredyt pozyczka kredyt bez bik podatek dochodowy
http://studencki-kredyt.pl/kredytu/mapa.html http://studencki-kredyt.pl/kredytu/mapa.html http://studencki-kredyt.pl/kredytw/ http://studencki-kredyt.pl/kredytz/mapa.html http://studencki-kredyt.pl/kredyts/ http://studencki-kredyt.pl/kredytt/mapa.html http://studencki-kredyt.pl/akcje/mapa.html http://studencki-kredyt.pl/inwestycje/mapa.html http://studencki-kredyt.pl/karta-kredytowa/mapa.html http://studencki-kredyt.pl/lokata/mapa.html http://studencki-kredyt.pl/notowania/mapa.html http://studencki-kredyt.pl/oprocentowanie/mapa.html http://studencki-kredyt.pl/pozyczka/mapa.html http://kredyty-studenckie.unl.pl/emerytura/mapa.html http://kredyty-studenckie.unl.pl/leasing/mapa.html http://kredyty-studenckie.unl.pl/prywatyzacja/mapa.html http://kredyty-studenckie.unl.pl/renta/mapa.html http://kredyty-studenckie.unl.pl/waluty/mapa.html

Anonymous said...

if you guys important to conjecture [url=http://www.generic4you.com]viagra[/url] online you can do it at www.generic4you.com, the most trusted viagra drugstore pro generic drugs.
you can tumescence into uncover drugs like [url=http://www.generic4you.com/Sildenafil_Citrate_Viagra-p2.html]viagra[/url], [url=http://www.generic4you.com/Tadalafil-p1.html]cialis[/url], [url=http://www.generic4you.com/VardenafilLevitra-p3.html]levitra[/url] and more at www.rxpillsmd.net, the top-priority [url=http://www.rxpillsmd.net]viagra[/url] informant on the web. well another great [url=http://www.i-buy-viagra.com]viagra[/url] pharmacy you can find at www.i-buy-viagra.com

citrate sildenafil said...

I really like this write! I enjoy it so much! thanks for give me a good reading moment!

Anonymous said...

Infatuation casinos? scrutinize this advanced [url=http://www.realcazinoz.com]online casino[/url] advisor and play online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
you can also into our additional [url=http://freecasinogames2010.webs.com]casino[/url] guide at http://freecasinogames2010.webs.com and be heir to in genuine change !
another new [url=http://www.ttittancasino.com]casino spiele[/url] bracket is www.ttittancasino.com , in lieu of of german gamblers, arrange manumitted online casino bonus.

Anonymous said...

Greets dude!

It is my first time here. I just wanted to say hi!

Anonymous said...

Predilection casinos? scrutinization this latest [url=http://www.realcazinoz.com]casino[/url] games. advisor and wing it reduce online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
you can also into our up to date [url=http://freecasinogames2010.webs.com]casino[/url] shun at http://freecasinogames2010.webs.com and replace in true compressed currency !
another lone [url=http://www.ttittancasino.com]casino[/url] spiele position is www.ttittancasino.com , because german gamblers, slip in loose online casino bonus.

Anonymous said...

new guys! end the latest untrammelled [url=http://www.casinolasvegass.com]casino[/url] games like roulette and slots !validate into public notice like a sparkle the all unmapped unburden [url=http://www.casinolasvegass.com]online casino[/url] games at the all late www.casinolasvegass.com, the most trusted [url=http://www.casinolasvegass.com]online casinos[/url] on the entanglement! dig our [url=http://www.casinolasvegass.com/download.html]free casino software download[/url] and be victorious in money.
you can also discontinuation other [url=http://sites.google.com/site/onlinecasinogames2010/]online casinos bonus[/url] . check out this new [url=http://www.place-a-bet.net/]online casino[/url].

Anonymous said...

well guys! check the latest unregulated rid of [url=http://www.casinolasvegass.com]casino[/url] games like roulette and slots !after outlet the all unexplored free [url=http://www.casinolasvegass.com]online casino[/url] games at the all new www.casinolasvegass.com, the most trusted [url=http://www.casinolasvegass.com]online casinos[/url] on the web! profit from our [url=http://www.casinolasvegass.com/download.html]free casino software download[/url] and gain a victory in money.
you can also control other [url=http://sites.google.com/site/onlinecasinogames2010/]online casinos bonus[/url] . check out this new [url=http://www.place-a-bet.net/]online casino[/url].

Anonymous said...

Greetings. I like your article. This is a nice site and I wanted to post a note to let you know. good job!

Anonymous said...

http://friends.rambler.ru/boynombvicoup@rambler.ru http://friends.rambler.ru/alrefjuncro@rambler.ru
japanese hot teen trixie teen hot

Anonymous said...

Hey i am suuper boy

Anonymous said...

Identical does not habitually on on the internet as mannerly articles as yours is. I cant hang about to look over some more of your works. [url=http://szkoleniaforex.info/]forex[/url]

buy generic cialis online said...

Well worth to read this article, thanks for sharing this information. With this article you offered me got a chance to know about this, anyway i say Great Article! and waiting for you next article about this interesting subject.

Anonymous said...

All of the strong painkillers have similar side effects. The most common are constipation & sickness. That's what i want to say here.

Anonymous said...

I would like to thank You for being the member of this website. Please allow me to have the possibility to show my satisfaction with Host Gator web hosting. They have professional and instant support and they also offer many [url=http://www.aboutus.org/HostingHostGatorCoupons.com ]Hostgator coupon codes[/url].

I like hostgator hosting, you will too.

http://pranjic.com.hr/smf/index.php?action=profile;u=13283