note 106580 added to function.ucwords
| From: | Anonymous at osu1 dot php dot net | Date: | Sun, 20 Nov 2011 19:06:06 +0000 |
| Subject: | note 106580 added to function.ucwords | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184584@lists.php.net to get a copy of this message | ||
Make the first letter of any word in capital even they are separated by hyphen.
Eg : donzé pierre-yves => Donzé Pierre-Yves
joye-cagnard frédéric => Joye-Cagnard Frédéric
<?php
$str = "donzé pierre-yves";
echo ucwordsHyphen($str); /*returns Donzé Pierre-Yves*/
function ucwordsHyphen($str){
return str_replace('- ','-',ucwords(str_replace('-','-
',$str)));
}
?>
Thanks.
----
Server IP: 195.221.21.36
Probable Submitter: 129.104.247.2
----
Manual Page -- http://www.php.net/manual/en/function.ucwords.php
Edit -- https://master.php.net/note/edit/106580
Del: integrated -- https://master.php.net/note/delete/106580/integrated
Del: useless -- https://master.php.net/note/delete/106580/useless
Del: bad code -- https://master.php.net/note/delete/106580/bad+code
Del: spam -- https://master.php.net/note/delete/106580/spam
Del: non-english -- https://master.php.net/note/delete/106580/non-english
Del: in docs -- https://master.php.net/note/delete/106580/in+docs
Del: other reasons-- https://master.php.net/note/delete/106580
Reject -- https://master.php.net/note/reject/106580
Search -- https://master.php.net/manage/user-notes.php