note 54450 deleted from function.ucwords by cmb
| From: | cmb@php.net | Date: | Sun, 17 Feb 2019 11:20:41 +0000 |
| Subject: | note 54450 deleted from function.ucwords by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210254@lists.php.net to get a copy of this message | ||
Note Submitter: radley25 at nospam dot spamcop dot net
----
In response to joshuamallory at yahoo dot com:
Using CSS to fix a PHP fault is not the ideal way to solve a problem. CSS is browser dependent and
can only be used when the data is presented in a web page. A better fix would be something like
this:
<?php
function better_ucwords($string) {
$string = ucwords($string);
$string = preg_replace('#[\\/][a-z]#e', "strtoupper('$0')",
$string);
return $string;
}
?>