以下PHP代码以此格式返回日期:
2010年7月27日下午7:36
我怎么能用大写字母返回日期?这就是我想要的;
2010年7月27日下午7:36
提前致谢,
约翰
PHP代码:
format('F j, Y &\nb\sp &\nb\sp g:i a')
答案 0 :(得分:7)
strtoupper()函数将字符串中的所有字符转换为大写。您可以通过以下方式使用它:
strtoupper(format('F j, Y &\nb\sp &\nb\sp g:i a'));
如果您遇到空格问题,请记住它是
。插入大写字母可能也不起作用。您可以尝试以下方法:
strtoupper(format('F j, Y'))." ".strtoupper(format('g:i a'));