日期 2016年6月6日 转成时间戳 用什么函数?
strtotime() 貌似要 2016-6-6 这样才行。

解决方案 »

  1.   

    $str = '2016年6月6日';
    preg_match_all('/\d+/',$str,$arr);
    $timer=implode('-',$arr[0]);
    echo $timer.'<br/>';
    $timer=strtotime($timer);
    echo $timer.'<br/>';
      

  2.   


    <?php
    $str='2016年6月6日';
    $str = str_replace(array('年','月','日'),array('-','-',''), $str);
    echo strtotime($str);
    ?>
      

  3.   


    <?php
    $str='2016年6月6日';
    $str = str_replace(array('年','月','日'),array('-','-',''), $str);
    echo strtotime($str);
    ?>