sbj
Well-known member
Hello, I have a php script to modify the titles of threads (to uppercase all words).
It works fine but I want to add exceptional words to the list, which should stay in all cases lowercase, except if it is the first word of the title.
Now this code is working fine, but the problem is
that all words "Ve" become to "ve". But obviously the first letter of the title should always be in Uppercase.
How can I add an exception to this rule like "NOT FIRST WORD?
It works fine but I want to add exceptional words to the list, which should stay in all cases lowercase, except if it is the first word of the title.
Now this code is working fine, but the problem is
PHP:
if (substr_count($title, 'Ve') > 0){
$patterns[0] = '/\bVe\b/';
$replacements[0] = 've';
$title = preg_replace($patterns, $replacements, $title);
}
that all words "Ve" become to "ve". But obviously the first letter of the title should always be in Uppercase.
How can I add an exception to this rule like "NOT FIRST WORD?
PHP:
if (substr_count($title, 'Ve') > 0 $$ NOT FIRST WORD){
$patterns[0] = '/\bVe\b/';
$replacements[0] = 've';
$title = preg_replace($patterns, $replacements, $title);
}