ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
[TOC] ### 函数 ``` function getAfterMonth($newMonth, $num){ $nowMonth = date('Y-m-d H:i:s', strtotime($newMonth."01")); $timestamp = strtotime("{$nowMonth} -$num month"); $newMonth = date('Ym', $timestamp); return $newMonth; } echo getAfterMonth('202001','0').PHP_EOL; // 202001 echo getAfterMonth('202001','1').PHP_EOL; // 201912 echo getAfterMonth('202001','2').PHP_EOL; // 201911 ```