I want to turn this text:
She’s saying it’s time to ‘find a solution’.
into this text:
She’s Saying It’s Time To ‘Find A Solution’.
I’m currently using both ucwords and this ucwords-related function to make capital letters after single quotes: (I found in the comment section of php.net.)
function ucwordsMore ($str) {
$str = str_replace("' ","'",ucwords(str_replace("'","' ",$str)));
return $str;
}
However, this function results in this:
She’S Saying It’S Time To ‘Find A Solution’.
How can I best keep letters after apostrophes small, and letters after single quotes big?
It usually works with a bit of pattern matching:
\wis okay for ASCII letters and numbers. For international text use\pLand the/umodifier.