CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2005
    Posts
    141

    php date list for specified duration

    hi

    is there any php classes or functions, which will gives us all the days from specific duration? for example, if i want a list of dates from 25/03/2010 (25th march 2010) to 15/05/2010 (15th May 2010), it will give me:

    25/03/2010
    26/03/2010
    26/03/2010
    ....
    ....
    ....
    14/05/2010
    15/05/2010

    thanks a lot for any help!

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: php date list for specified duration

    Use date() and strtotime(). Start with your first date and then just keep adding 1 day until you have it. All it takes are those two functions and a for loop.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured