Uppercase date format

The following PHP code returns dates in this format:

July 27, 2010 7:36 pm

How can I return capitalized dates? Here is what I want;

July 27, 2010 7:36

Thanks in advance,

John

PHP code:

format('F j, Y &\nb\sp &\nb\sp g:i a')
+3
source share
1 answer

The strtoupper () function converts all characters in a string to uppercase. You can use it as follows:

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

If you have problems with spaces, remember that it is  . Inserting capital there may also not work. You can try the following:

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

Source: https://habr.com/ru/post/1760002/


All Articles