note 105521 deleted from function.ucwords by danbrown
| From: | danbrown@php.net | Date: | Wed, 24 Aug 2011 13:52:54 +0000 |
| Subject: | note 105521 deleted from function.ucwords by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182700@lists.php.net to get a copy of this message | ||
Note Submitter: betolima at gmail dot com
Reason: non-english
----
Aproveitanto a função mb_ucwords resolvi adicionar mais alguns detalhes para minha
necessidade.
segue:
function mb_ucwords($str, $rem_delimiter = null) {
if (isset($rem_delimiter)) {
$str = str_replace($rem_delimiter," ",$str);
}
$str = mb_convert_case($str, MB_CASE_TITLE, "UTF-8");
return ($str);
}
example:
echo mb_ucwords("João-da-Silva","-");