-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathmb-strwidth.xml
More file actions
171 lines (164 loc) · 5.57 KB
/
mb-strwidth.xml
File metadata and controls
171 lines (164 loc) · 5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 64f2f1c70d2f42507d9c624e09dcf486ceca7be5 Maintainer: hirokawa Status: ready -->
<!-- CREDITS: takagi -->
<refentry xml:id="function.mb-strwidth" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mb_strwidth</refname>
<refpurpose>文字列の幅を返す</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>mb_strwidth</methodname>
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
文字列 <parameter>string</parameter> の幅を返します。
半角文字は <literal>1</literal> として、
全角文字は <literal>2</literal> として数えます。
東アジアの文字の長さに関する詳細は
<link xlink:href="&url.unicode.reports.tr;11/">&url.unicode.reports.tr;11/</link>
を参照ください。
</para>
<para>
全角文字は次のとおりです。
<literal>U+1100</literal>-<literal>U+115F</literal>、
<literal>U+11A3</literal>-<literal>U+11A7</literal>、
<literal>U+11FA</literal>-<literal>U+11FF</literal>、
<literal>U+2329</literal>-<literal>U+232A</literal>、
<literal>U+2E80</literal>-<literal>U+2E99</literal>、
<literal>U+2E9B</literal>-<literal>U+2EF3</literal>、
<literal>U+2F00</literal>-<literal>U+2FD5</literal>、
<literal>U+2FF0</literal>-<literal>U+2FFB</literal>、
<literal>U+3000</literal>-<literal>U+303E</literal>、
<literal>U+3041</literal>-<literal>U+3096</literal>、
<literal>U+3099</literal>-<literal>U+30FF</literal>、
<literal>U+3105</literal>-<literal>U+312D</literal>、
<literal>U+3131</literal>-<literal>U+318E</literal>、
<literal>U+3190</literal>-<literal>U+31BA</literal>、
<literal>U+31C0</literal>-<literal>U+31E3</literal>、
<literal>U+31F0</literal>-<literal>U+321E</literal>、
<literal>U+3220</literal>-<literal>U+3247</literal>、
<literal>U+3250</literal>-<literal>U+32FE</literal>、
<literal>U+3300</literal>-<literal>U+4DBF</literal>、
<literal>U+4E00</literal>-<literal>U+A48C</literal>、
<literal>U+A490</literal>-<literal>U+A4C6</literal>、
<literal>U+A960</literal>-<literal>U+A97C</literal>、
<literal>U+AC00</literal>-<literal>U+D7A3</literal>、
<literal>U+D7B0</literal>-<literal>U+D7C6</literal>、
<literal>U+D7CB</literal>-<literal>U+D7FB</literal>、
<literal>U+F900</literal>-<literal>U+FAFF</literal>、
<literal>U+FE10</literal>-<literal>U+FE19</literal>、
<literal>U+FE30</literal>-<literal>U+FE52</literal>、
<literal>U+FE54</literal>-<literal>U+FE66</literal>、
<literal>U+FE68</literal>-<literal>U+FE6B</literal>、
<literal>U+FF01</literal>-<literal>U+FF60</literal>、
<literal>U+FFE0</literal>-<literal>U+FFE6</literal>、
<literal>U+1B000</literal>-<literal>U+1B001</literal>、
<literal>U+1F200</literal>-<literal>U+1F202</literal>、
<literal>U+1F210</literal>-<literal>U+1F23A</literal>、
<literal>U+1F240</literal>-<literal>U+1F248</literal>、
<literal>U+1F250</literal>-<literal>U+1F251</literal>、
<literal>U+20000</literal>-<literal>U+2FFFD</literal>、
<literal>U+30000</literal>-<literal>U+3FFFD</literal>。
他のすべての文字は半角の文字です。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<para>
幅を取得したい文字列。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>encoding</parameter></term>
<listitem>
&mbstring.encoding.parameter;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
文字列 <parameter>string</parameter> の幅を返します。
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
&mbstring.changelog.encoding-nullable;
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example xml:id="mb-strwidth.example.basic">
<title><function>mb_strwidth</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
var_dump(
mb_strwidth('a'), // LATIN SMALL LETTER A
mb_strwidth("\u{ff41}") // FULLWIDTH LATIN SMALL LETTER A
);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
int(1)
int(2)
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mb_strimwidth</function></member>
<member><function>mb_internal_encoding</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->