|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-08-24 17:42 UTC] kalle@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 03:00:01 2025 UTC |
Description: ------------ Three of four ASCII case conversion functions have equivalent modes of mb_convert_case(): 1. strtoupper -> MB_CASE_UPPER 2. strtolower -> MB_CASE_LOWER 3. ucwords -> MB_CASE_TITLE 4. ucfirst -> ??? What's with the fourth? Would come in handy when you use some dynamic text at the beginning of a sentence. Test script: --------------- /* example by info at yasarnet dot com */ function capitalize($str, $encoding = 'UTF-8') { return mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding) . mb_strtolower(mb_substr($str, 1, mb_strlen($str), $encoding), $encoding); }