Sunday , 15 September 2019
Breaking News
Home > Tutorials > PHP > Add or Subtract Days from Current Date in Php

Add or Subtract Days from Current Date in Php

T oday I am going to tech you that how to add or subtract days from current date in php. I often use this code for getting my required date. So let’s start. Look at below code:-
Add you can see we used two functions date() and strtotime(), in date() function we have supplied format for date and in strtotime we have add 7 days and then echo it. Similarly we can subtract days from current date. In the above example we used current date but you can also used your custom date. See below code
I think there is nothing complicated in above example. We just used custom date instead of current date. If you need some more help, please ask in comment. You can download source code from below.

Download

About Muhammad Faryad

Muhammad Faryad is a professional web application developer. He has been working for 5 years in ICE786 Technologies Pvt. Ltd as a Senior Programmer and Developer. You can contact him on facebook at www.facebook.com/tolamangali

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Ad Test