note 106598 added to function.ucwords

From: Date: Mon, 21 Nov 2011 17:14:23 +0000
Subject: note 106598 added to function.ucwords
Groups: php.notes 
Request: Send a blank email to php-notes+get-184602@lists.php.net to get a copy of this message
Thanks a lot brother. I tested it with a few variations. It works perfectly. Its really great and simple usage of the existing functions. It would be glad to all PHP folks and good to PHP if these kind of functions will be in PHP library on upcoming releases. <?php $name1 = "mark-yves robert"; $name2 = "mark-yves robert-bryan"; echo '<br/>Name 1 (mark-yves robert) =>'. ucwordspecific($name1,'-'); //returns Mark-Yves Robert echo '<br/>Name 2 (mark-yves robert-bryan) =>'.ucwordspecific($name2,'-'); //returns Mark-Yves Robert-Bryan function ucwordspecific($str,$delimiter){ $delimiter_space = '- '; return str_replace($delimiter_space,$delimiter,ucwords (str_replace($delimiter,$delimiter_space,$str))); } ?> Proud to be a PHP enthusiast always :-) ---- Server IP: 195.221.21.36 Probable Submitter: 111.92.50.175 ---- Manual Page -- http://www.php.net/manual/en/function.ucwords.php Edit -- https://master.php.net/note/edit/106598 Del: integrated -- https://master.php.net/note/delete/106598/integrated Del: useless -- https://master.php.net/note/delete/106598/useless Del: bad code -- https://master.php.net/note/delete/106598/bad+code Del: spam -- https://master.php.net/note/delete/106598/spam Del: non-english -- https://master.php.net/note/delete/106598/non-english Del: in docs -- https://master.php.net/note/delete/106598/in+docs Del: other reasons-- https://master.php.net/note/delete/106598 Reject -- https://master.php.net/note/reject/106598 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#184602) next »