$date = "2018-07-02 20:40:00";
$a = strtotime($date); //转换时间戳函数strtotime()
echo $a.'<br>';
$b = date('m',$a); //取出该日期的月份进行打印
echo $b;
运行结果::
$date = "2018-07-02 20:40:00";
$a = strtotime($date); //转换时间戳函数strtotime()
echo $a.'<br>';
$b = date('m',$a); //取出该日期的月份进行打印
echo $b;
运行结果::