开发者

Date format with all capital letters

开发者 https://www.devze.com 2023-01-11 16:35 出处:网络
The PHP code below returns dates in this format: July 27, 20107:36 pm How could I make it return dates with capital letters?Here\'s what I want;

The PHP code below returns dates in this format:

July 27, 2010 7:36 pm

How could I make it return dates with capital letters? Here's what I want;

JULY 27, 2010 7开发者_高级运维:36 PM

Thanks in advance,

John

The PHP code:

format('F j, Y &\nb\sp &\nb\sp g:i a')


The strtoupper() function converts all the characters in a string to uppercase. You can use it in the following way:

strtoupper(format('F j, Y &\nb\sp &\nb\sp g:i a'));

If you have having problems with the spaces, remember that it's  . Inserting capitals there might not work either. You could try the following:

strtoupper(format('F j, Y'))."  ".strtoupper(format('g:i a'));
0

精彩评论

暂无评论...
验证码 换一张
取 消