<?php
//日期
$date
=
"2019/12/01"
;
//转换成时间戳
$timestamp
=
strtotime
(
$date
);
//输出月份
echo
date
(
'm'
,$timestamp);
//输出年份
echo
date
(
'Y'
,$timestamp);
<?php
//日期
$date
=
"2019/12/01"
;
//转换成时间戳
$timestamp
=
strtotime
(
$date
);
//输出月份
echo
date
(
'm'
,$timestamp);
//输出年份
echo
date
(
'Y'
,$timestamp);