<?php
   $str = "2017-02-27 13:40:42";
   $first=explode(' ',$str);
   $second=explode('-', $first['0']);
    $three=explode('-', $first['0'])['2'];
    print_r($first);
    echo "<br>";
    print_r($second);
    echo "<br>";
    print_r($three);
?>

php explode时间分割_php