This function returns the Titlized version of a string, meaning that it uppercases the first letter of all words except for articles such as “a” and “the”, prepositions such as “of”, “in”, “on”, “during”, and “between”, and conjunctions such as “and” and “with” that are not the first word.
titlize("this is rock and roll baby")would return
This Is Rock and Roll Baby.
Feel free to implement it in WordPress if it’s good enough. I’d be very pleased.
- You must be logged in to reply to this topic.