Capitalize the first letter of each word in PHP

<?php $example = "lower case words to upper."; echo ucwords($example); ?>
Replaces the first lowercase letter of each word in a string to uppercase.

1 Response

What about CSS for this?

p {
text-transform: capitalize;
}

Should do the trick doesn't it?

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.