note 14706 deleted from function.strtolower.php by philip
| From: | philip@php.net | Date: | Fri, 10 Aug 2001 17:59:23 +0000 |
| Subject: | note 14706 deleted from function.strtolower.php by philip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16554@lists.php.net to get a copy of this message | ||
FROM: danny cook
This is a function that turns a normal string into Title Case (I also put it into the strtoupper and
strtolower comments..)
<?
function strtotitle($str) {
$firstletter = substr($str,0,1);
$firstletter = strtoupper($firstletter);
return $firstletter.substr($str,1);
}
?>
ps: to the people who develop php: a function like this already embedded in the code would be very
useful, as well as maintaining consistency with strtoupper and strtolower functions...