+1  A: 

I'm confused at what exactly you're trying to do. PHP already has a ucwords() function that can do this and I don't see any difference in what you're doing... If you're capitalizing the first letter of each word, do delimiters make any difference? Does it matter at all that there's a '&' between the two words?

Edit: I think I understand now. I assume the only problem you're having is that you can't tell it's uppercasing the text because it's already all uppercased, all you need to do is lowercase it first. I also changed it to completely get rid of the 'next character' thing, it was unnecessary. If you find a match, just change the next character to uppercase. Try this:

// method in stringModify Class
function capitalizeWords($words, $charList) {
    $words = strtolower($words); // lowercase everything that isn't capitalized
    for ($i = 0; $i < strlen($words); $i++) {
        if (strpos($charList, $words[$i]) !== false) $words[$i+1] = strtoupper($words[$i+1]);
    }
    return $words;
}
// Calling method
$stringModify->capitalizeWords("WELLNESS & RENOMME", " -&");
animuson
this returns "wellness Renomme" for me.
Paulie
animuson
animuson
// result:Array ( [name] => wellness Renomme [name2] => WELLNESS $hsql_results[name2] = $dummy;i dont get it, no function on the internet is working for this string on my computer. :-D
Paulie
+1  A: 
function cb($word){ return ucwords(strtolower($word[0])); }
var_dump(preg_replace_callback('@[A-z]+@i','cb','TESTING-TESTING / TESTING & TEST / testing*&^123!&%&*TEST'));
Jimmy Ruska