FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


HomeWatched TopicsRegisterSearchDirectory
FAQMemberlistUsergroupsLog inStoresItemsBank
Google

Reply to topic Page 1 of 1
using a date in a loop
Message  

Reply with quote
Post using a date in a loop 
Can you use a date in a loop and then increment the date?
so if
Code:

$x = 2005-04-28;

++$x;
echo "$x";



output would be 2005-04-29

if this works then would it auto detect invalid dates and leap years?


_________________
Sarah Atkinson
View user's profile Send private message Send e-mail

Reply with quote
Post  
That will not work the way you want it to.  It would be much more complicated to do that.

View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger

Reply with quote
Post  
Theres 2 way :

1. Use three different variables for day,month,year and check if month > 12,....

2. Use the timestamp instead and let the php date function do the rest
http://ca.php.net/manual/fr/function.mktime.php

View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  



Google

FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


Web Design by PlatinumShore.com & Web Hosting by TradeWebHosting.com