1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-24 07:42:22 +01:00
Files
archived-doc-ru/reference/mbstring/functions/mb-strwidth.xml
Mikhail Alferov 401b3612ee Обновление перевода (#649)
Co-authored-by: Sergey Panteleev <sergey@php.net>
2024-01-08 19:13:39 +03:00

172 lines
5.9 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 64f2f1c70d2f42507d9c624e09dcf486ceca7be5 Maintainer: tmn Status: ready -->
<!-- Reviewed: no -->
<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>
Возвращает ширину строки (<type>string</type>) <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>
Исходная строка (<type>string</type>).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>encoding</parameter></term>
<listitem>
&mbstring.encoding.parameter;
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает ширину строки (<type>string</type>) <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></title>
<programlisting role="php">
<![CDATA[
<?php
var_dump(
mb_strwidth('a'), // латинская строчная буква а
mb_strwidth("\u{ff41}") // латинская строчная буква а полной ширины
);
?>
]]>
</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
-->