Ok, lets talk a little bit about eregi_replace:
eregi_replace("([[:punct:]][[:space:]]*)([[:alpha:]])", "\1\2", $string);
Now this part is easy. It gets each punc and space* and assigns it to 1, and alpha as two. In the replace parameter, is replaces them with itself, fine. Doesn't do anything exactly, but it's a leadin to what I want to do:
What if I want to parse these replacements through a function as such:
eregi_replace("([[:punct:]][[:space:]]*)([[:alpha:]])", strtoupper("\1\2"), $string);
But the function reads "\1\2", not their replacements. How do I get it to read their replacements?
What I want to do is just have a regular expression (or something) that capitalises first words in a sentence.