从日期获取PHP中的月份名称 [英] Get month name in PHP from date
本文介绍了从日期获取PHP中的月份名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在php函数中有一个日期,如下所示:
I have a date in my php function like following:
2016-05-17 16:41:51
有没有办法让我从PHP获取这个日期的月份名称?
Is there some way for me to get the month name from this date in PHP ?
推荐答案
使用date参数中的 F
可以获取月份名称。
Using the F
in the date parameter you can get the month name.
echo date("F", strtotime('2016-05-17 16:41:51')); //May
这篇关于从日期获取PHP中的月份名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文