$strtotime=strtotime('2018-01-06');
$y=date('Y',$strtotime);
$ys=date('Y',time());
$m=(int)date('m',$strtotime);
$ms=(int)date('m',time());
$chaY=$ys-$y;
//月份相差多少
$chaM=12-$m + $ms;
//相差一年就加12
$yearmeth=$chaM + (($chaY-1) *12);
echo $meth;
$strtotime=strtotime('2018-01-06');
$y=date('Y',$strtotime);
$ys=date('Y',time());
$m=(int)date('m',$strtotime);
$ms=(int)date('m',time());
$chaY=$ys-$y;
//月份相差多少
$chaM=12-$m + $ms;
//相差一年就加12
$yearmeth=$chaM + (($chaY-1) *12);
echo $meth;