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  阅读(375)  评论(0编辑  收藏  举报