Answers for "add month in php"

PHP
2

adding months in php

## CURRENT DATE + ANY DATES YOU WANT TO ADD
echo date("Y-m-d", strtotime($date."+5 days"));
echo date("Y-m-d", strtotime($date."+5 weeks"));
echo date("Y-m-d", strtotime($date."+5 months"));
echo date("Y-m-d", strtotime($date."+5 years"));
Posted by: Guest on April-09-2022
4

+1 month php

$time = strtotime("2010.12.11");
$final = date("Y-m-d", strtotime("+1 month", $time));
Posted by: Guest on August-07-2020
-1

get month days in php

echo cal_days_in_month(CAL_GREGORIAN, 8, 2009);
Posted by: Guest on October-19-2020

Browse Popular Code Answers by Language