strftime make first letter capital (uppercase) in PHP

user1384668 picture user1384668 · Jun 3, 2012 · Viewed 9k times · Source

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? :)

Answer

Simone picture Simone · Jun 3, 2012

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

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