note 16551 deleted from function.ucwords by cmb
| From: | cmb@php.net | Date: | Sun, 04 Aug 2019 08:44:32 +0000 |
| Subject: | note 16551 deleted from function.ucwords by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211786@lists.php.net to get a copy of this message | ||
Note Submitter: Julienc at psychologie-fr dot com
----
Its still possible to clean a bit more the previous sample:
$string=strtolower($string); $break=true;
for ($i=0; $i < strlen($string); $i++) { $subed=$string[$i];
if (((ord($subed) > 64) && (ord($subed) < 123)) || ((ord($subed) > 48) &&
(ord($subed) < 58))) {
if ($break) { $string[$i] = strtoupper($subed); }
$break=false; } else { $break=true; }
}
- Julien