Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

strftime make first letter capital (uppercase) in PHP

Tags:

php

strftime

I have code:

<?php echo strftime("%Y %B %e, %A")?>

In some languages I get:

2012 junio 3, domingo

I want that first letter of all words would be uppercase (capital), so it would look like:

2012 Junio 3, Domingo

I didn't find any answer in internet, does anybody have an idea? :)

like image 492
user1384668 Avatar asked Jun 03 '12 20:06

user1384668


People also ask

How can I uppercase first letter in PHP?

The ucfirst() function converts the first character of a string to uppercase. Related functions: lcfirst() - converts the first character of a string to lowercase. ucwords() - converts the first character of each word in a string to uppercase.

How do I make the first letter capital automatically?

To use a keyboard shortcut to change between lowercase, UPPERCASE, and Capitalize Each Word, select the text and press SHIFT + F3 until the case you want is applied.

Which function returns first letter of word in uppercase?

The toUpperCase() method converts the string to uppercase.


1 Answers

Try echo ucwords(strftime("%Y %B %e, %A"));

http://php.net/manual/en/function.ucwords.php

like image 145
Simone Avatar answered Oct 11 '22 14:10

Simone