Add days to a date in PHP

前端 未结 7 1833
情深已故
情深已故 2020-12-15 08:42

Is there any php function available where I can add days to a date to make up another date? For example, I have a date in the following format: 27-December-2011

If I

7条回答
  •  再見小時候
    2020-12-15 09:24

    Actually it's easier than all that.

    $some_var = date("Y-m-d",strtotime("+7 day"))
    

    You can use a variable instead of the string, of course. It will be great if the people answering the questions, won't complicate things. Less code, means less time to waste on the server ;).

提交回复
热议问题