reference/mbstring/functions/mb-convert-case.xml
d6f54016d62904cfd8200604aadd5e3f0d9bad97
...
...
@@ -10,9 +10,9 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>string</type><methodname>mb_convert_case</methodname>
13
-
<methodparam><type>string</type><parameter>str</parameter></methodparam>
13
+
<methodparam><type>string</type><parameter>string</parameter></methodparam>
14
14
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
15
-
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter><initializer>mb_internal_encoding()</initializer></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
Performs case folding on a <type>string</type>, converted in the way specified by
...
...
@@ -25,7 +25,7 @@
25
25
<para>
26
26
<variablelist>
27
27
<varlistentry>
28
-
<term><parameter>str</parameter></term>
28
+
<term><parameter>string</parameter></term>
29
29
<listitem>
30
30
<para>
31
31
The <type>string</type> being converted.
...
...
@@ -38,8 +38,13 @@
38
38
<para>
39
39
The mode of the conversion. It can be one of
40
40
<constant>MB_CASE_UPPER</constant>,
41
-
<constant>MB_CASE_LOWER</constant>, or
42
-
<constant>MB_CASE_TITLE</constant>.
41
+
<constant>MB_CASE_LOWER</constant>,
42
+
<constant>MB_CASE_TITLE</constant>,
43
+
<constant>MB_CASE_FOLD</constant>,
44
+
<constant>MB_CASE_UPPER_SIMPLE</constant>,
45
+
<constant>MB_CASE_LOWER_SIMPLE</constant>,
46
+
<constant>MB_CASE_TITLE_SIMPLE</constant>,
47
+
<constant>MB_CASE_FOLD_SIMPLE</constant>.
43
48
</para>
44
49
</listitem>
45
50
</varlistentry>
...
...
@@ -61,19 +66,43 @@
61
66
</para>
62
67
</refsect1>
63
68

64
-
<refsect1 role="unicode">
65
-
&reftitle.unicode;
69
+
<refsect1 role="changelog">
70
+
&reftitle.changelog;
66
71
<para>
67
-
By contrast to the standard case folding functions such as
68
-
<function>strtolower</function> and <function>strtoupper</function>,
69
-
case folding is performed on the basis of the Unicode character
70
-
properties. Thus the behaviour of this function is not affected
71
-
by locale settings and it can convert any characters that have
72
-
'alphabetic' property, such as A-umlaut (Ä).
73
-
</para>
74
-
<para>
75
-
For more information about the Unicode properties, please see <link
76
-
xlink:href="&url.unicode.reports;">&url.unicode.reports;</link>.
72
+
<informaltable>
73
+
<tgroup cols="2">
74
+
<thead>
75
+
<row>
76
+
<entry>&Version;</entry>
77
+
<entry>&Description;</entry>
78
+
</row>
79
+
</thead>
80
+
<tbody>
81
+
<row>
82
+
<entry>8.3.0</entry>
83
+
<entry>
84
+
Implemented conditional casing rules for the Greek letter sigma
85
+
which only apply to <constant>MB_CASE_LOWER</constant>
86
+
and <constant>MB_CASE_TITLE</constant> modes, not
87
+
to <constant>MB_CASE_LOWER_SIMPLE</constant> and
88
+
<constant>MB_CASE_TITLE_SIMPLE</constant>.
89
+
</entry>
90
+
</row>
91
+
<row>
92
+
<entry>7.3.0</entry>
93
+
<entry>
94
+
Added support for
95
+
<constant>MB_CASE_FOLD</constant>,
96
+
<constant>MB_CASE_UPPER_SIMPLE</constant>,
97
+
<constant>MB_CASE_LOWER_SIMPLE</constant>,
98
+
<constant>MB_CASE_TITLE_SIMPLE</constant>, and
99
+
<constant>MB_CASE_FOLD_SIMPLE</constant>
100
+
as <parameter>mode</parameter>.
101
+
</entry>
102
+
</row>
103
+
</tbody>
104
+
</tgroup>
105
+
</informaltable>
77
106
</para>
78
107
</refsect1>
79
108

...
...
@@ -87,9 +116,9 @@
87
116
<?php
88
117
$str = "mary had a Little lamb and she loved it so";
89
118
$str = mb_convert_case($str, MB_CASE_UPPER, "UTF-8");
90
-
echo $str; // Prints MARY HAD A LITTLE LAMB AND SHE LOVED IT SO
119
+
echo $str, PHP_EOL;
91
120
$str = mb_convert_case($str, MB_CASE_TITLE, "UTF-8");
92
-
echo $str; // Prints Mary Had A Little Lamb And She Loved It So
121
+
echo $str, PHP_EOL;
93
122
?>
94
123
]]>
95
124
</programlisting>
...
...
@@ -104,9 +133,9 @@ echo $str; // Prints Mary Had A Little Lamb And She Loved It So
104
133
<?php
105
134
$str = "Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός";
106
135
$str = mb_convert_case($str, MB_CASE_UPPER, "UTF-8");
107
-
echo $str; // Prints ΤΆΧΙΣΤΗ ΑΛΏΠΗΞ ΒΑΦΉΣ ΨΗΜΈΝΗ ΓΗ, ΔΡΑΣΚΕΛΊΖΕΙ ΥΠΈΡ ΝΩΘΡΟΎ ΚΥΝΌΣ
136
+
echo $str, PHP_EOL;
108
137
$str = mb_convert_case($str, MB_CASE_TITLE, "UTF-8");
109
-
echo $str; // Prints Τάχιστη Αλώπηξ Βαφήσ Ψημένη Γη, Δρασκελίζει Υπέρ Νωθρού Κυνόσ
138
+
echo $str, PHP_EOL;
110
139
?>
111
140
]]>
112
141
</programlisting>
...
...
@@ -114,6 +143,22 @@ echo $str; // Prints Τάχιστη Αλώπηξ Βαφήσ Ψημένη Γη,
114
143
</para>
115
144
</refsect1>
116
145

146
+
<refsect1 role="notes">
147
+
&reftitle.notes;
148
+
<para>
149
+
By contrast to the standard case folding functions such as
150
+
<function>strtolower</function> and <function>strtoupper</function>,
151
+
case folding is performed on the basis of the Unicode character
152
+
properties. Thus the behaviour of this function is not affected
153
+
by locale settings and it can convert any characters that have
154
+
'alphabetic' property, such a-umlaut (ä).
155
+
</para>
156
+
<para>
157
+
For more information about the Unicode properties, please see <link
158
+
xlink:href="&url.unicode.reports;">&url.unicode.reports;</link>.
159
+
</para>
160
+
</refsect1>
161
+

117
162
<refsect1 role="seealso">
118
163
&reftitle.seealso;
119
164
<para>
...
...
@@ -128,7 +173,6 @@ echo $str; // Prints Τάχιστη Αλώπηξ Βαφήσ Ψημένη Γη,
128
173
</para>
129
174
</refsect1>
130
175
</refentry>
131
-

132
176
<!-- Keep this comment at the end of the file
133
177
Local variables:
134
178
mode: sgml
135
179