「PHP」strtotime()で日付の計算(加算、減算)コード
PHPコード:
<?php
//+ 1 year
$add_year = date('Y-m-d’,strtotime(“$date + 1 year"));
echo $add_year;
//+1 day
$add_day= date('Y-m-d’,strtotime(“2017-05-26 + 1 day"));
echo $date_tomorrow;
//+ 1 week
$add_week = date('Y-m-d’,strtotime(“$date + 1 week"));
echo $add_week;
?>