UCWords

Every now and then I find that I need to do something that seems remarkably obscure, and am surprised to learn that PHP has a function to do it. I found myself cleaning up a really sub-par Wikipedia article, where someone had entered a massive list of things in ALL CAPS.

It’s easy enough to upper-case everything, or to lower-case everything. But what I really wanted to was to capitalize the first letter of each word, because they’re all proper nouns. It turns out that PHP has a ucwords function to do precisely this.

And thus this page, which I suspect will never be useful to anyone, was born. Enter text, and it’ll covert it to lowercase, but upper-case the first letter of each word. And in this case, the time required to write the script was less than the time it’d have taken me to change it all by hand.

2 thoughts on “UCWords

  1. That reminds me of TPU. It was basically a language for editing. The formal editor that was written using it was called EVE. It was amazing. I highly customized it for my own use and one of the things I added was a simple functionto do what ucwords does. Saved me lots and lots of time. I miss that editor.

Leave a Reply

Your email address will not be published. Required fields are marked *