php把时间格式化

如题,把如 2013-6-12 12:00 格式化为 2013-6--12

可以先将时间转换下,然后重新将时间格式化显示:


echo date("Y-m-d", strtotime($newsArr['news_time']));
posted on 2013-06-21 10:29  yun007  阅读(378)  评论(0)    收藏  举报