$personInfo['mantra'] is the piece that I'm working with. I want everything to be capitalized, with the exception of prepositions and articles (e.g. 'a', 'an', 'the', etc.) Is there an efficient way to do this? I'm doing this as ucwords(strtolower($personInfo['mantra'])) so far, but obviously this does not take into account the prepositions and articles remaining lowercase.
A mantra is all capitalized (e.g. 'I LIVE THE WAY I WANT') in the database, and there are thousands, so it is not practical to manually change them. To provide an example, I would like the sentence: 'I LIVE THE WAY I WANT' to become 'I Live the Way I Want'.