yangzailu

导航

php explode时间分割

<?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);
?>

 

posted on 2017-02-27 15:32  飞离地平线  阅读(385)  评论(0)    收藏  举报