note 23910 added to function.ucwords
| From: | php_net at jvhovig dot remove dot three dot words dot com | Date: | Wed, 31 Jul 2002 17:32:20 +0000 |
| Subject: | note 23910 added to function.ucwords | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34052@lists.php.net to get a copy of this message | ||
I use the following in place of ucwords() when I need capitalization despite unpredictable
punctuation.
$text = preg_replace(
'/([^A-Za-z][A-Za-z])/e',
'strtoupper("$1")',
$text
);
--
http://www.php.net/manual/en/function.ucwords.php
http://master.php.net/manage/user-notes.php?action=edit+23910
http://master.php.net/manage/user-notes.php?action=delete+23910
http://master.php.net/manage/user-notes.php?action=reject+23910