PHP date_add() Function

PHP date_add Function


Definition :

The  date_add() function is a built-in function in PHP.The date_add() function is used to adds some days, months, years, hours, minutes, and seconds to a date.

Syntax

date_add(object, interval)

Parameter:
Parameter Description
object Required. Specifies a DateTime object returned by date_create()
interval Required. Specifies a DateInterval object

Given below examples Add 40 days to the 16th of April, 2015:


Output : 2015-05-26