note 18341 added to function.ucwords
| From: | php-general at lists dot php dot net | Date: | Fri, 18 Jan 2002 23:14:34 +0000 |
| Subject: | note 18341 added to function.ucwords | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-25074@lists.php.net to get a copy of this message | ||
This seems to be what people want:
function uc_all($string) {
$temp = preg_split('/(\W)/', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
print_r($temp);
foreach ($temp as $key=>$word) {
$temp[$key] = ucfirst($word);
}
return join ('', $temp);
}
--
http://www.php.net/manual/en/function.ucwords.php
http://master.php.net/manage/user-notes.php?action=edit+18341
http://master.php.net/manage/user-notes.php?action=delete+18341
http://master.php.net/manage/user-notes.php?action=reject+18341