note 29691 deleted from function.ucwords by victor
| From: | victor@php.net | Date: | Sat, 12 Jun 2004 21:09:39 +0000 |
| Subject: | note 29691 deleted from function.ucwords by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-70988@lists.php.net to get a copy of this message | ||
Note Submitter: un-thesis@wakeup-people.com
----
This will capitalize words beginning with every major English punctuation symbol. You can add your
own (foreign) symbols here as well :-)
$words = "What?No delimiters,shit happens;all the time!here:this--solves (definately) [many
more] all problems.";
$words = str_replace(Array("(", "-", ".", "?",
",",":","[",";","!"), Array("( ",
"- ", ". ", "? ", ", ",": ","[ ",";
","! "), $words);
$words = ucwords(strtolower($words));
$words = str_replace(Array("( ", "- ", ". ", "? ", ",
",": ","[ ","; ","! "), Array("(",
"-", ".", "?",
",",":","[",";","!"), $words);
print "$words\n";