我想使用php将2013年2月26日类型的日期fomat转换为2013年02月26日格式我可以按照做很长的路
$date='26-Feb-2013';
$datew=explode('-',$date);
$mounth=$datew[1];
if($mounth=='Jan'){
$mounth=='Jan'
}
elseif($mounth=='feb'){
$mounth=='Feb'
}
并再次使用内爆函数转换26-02-2013格式但我想知道有什么简单的方法有办法做到这一点吗?
$date='26-Feb-2013';
echo date("d-m-Y", strtotime($date)); // prints 26-02-2013
试试这个:
$date='26-Feb-2013';
$datew= date('d-m-Y',strtotime($date));
修正了在提交之前应该测试的遗憾
试用此
$date='26-Feb-2013';
echo $datew = date('d-m-Y',strtotime($date));