php add days date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scan87
    New Member
    • Feb 2007
    • 24

    php add days date

    Hello everyone,

    I have a problem with my PHP code. I want to add specific number of days to the current date, so that it will display the correct date after adding the number of days to the current date. For example the current date can be today's date and the number of days I would like to add is 4 days.

    My PHP code:

    [PHP]
    <?php
    $today = date("Y-m-d");
    ?>
    [/PHP]


    Please can someone help me on this. Thanx in advance.
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Use strtotime instead.

    See the first example on the linked page.

    Comment

    • scan87
      New Member
      • Feb 2007
      • 24

      #3
      Originally posted by hsriat
      Use strtotime instead.

      See the first example on the linked page.
      Thank you Sir.....It worked

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        You are welcome :)

        Comment

        Working...