1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-26 00:32:15 +01:00
Files
archived-doc-ru/reference/mbstring/functions/mb-encoding-aliases.xml
2024-03-31 04:24:23 +03:00

149 lines
3.8 KiB
XML
Raw 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: 96bc008584eaea7d899b13234a88b1d84f82032b Maintainer: northcat Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.mb-encoding-aliases" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mb_encoding_aliases</refname>
<refpurpose>Получает псевдонимы известного типа кодировки</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>mb_encoding_aliases</methodname>
<methodparam><type>string</type><parameter>encoding</parameter></methodparam>
</methodsynopsis>
<para>
Функция возвращает массив псевдонимов для известного типа
кодировки <parameter>encoding</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>encoding</parameter></term>
<listitem>
<para>
Кодировка, для которой будут проверены псевдонимы.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Функция возвращает индексный массив с псевдонимами кодировки.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Функция выбрасывает исключение <classname>ValueError</classname>, если
кодировка <parameter>encoding</parameter> неизвестна.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
Если параметр <parameter>encoding</parameter> неизвестен,
теперь выбрасывается исключение <classname>ValueError</classname>;
раньше функция выдавала ошибку уровня
<constant>E_WARNING</constant> и возвращала &false;.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title>Пример использования функции <function>mb_encoding_aliases</function></title>
<programlisting role="php">
<![CDATA[
<?php
$encoding = 'ASCII';
$known_encodings = mb_list_encodings();
if (in_array($encoding, $known_encodings)) {
$aliases = mb_encoding_aliases($encoding);
print_r($aliases);
} else {
echo "Неизвестная кодировка ($encoding).\n";
}
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Array
(
[0] => ANSI_X3.4-1968
[1] => iso-ir-6
[2] => ANSI_X3.4-1986
[3] => ISO_646.irv:1991
[4] => US-ASCII
[5] => ISO646-US
[6] => us
[7] => IBM367
[8] => cp367
[9] => csASCII
)
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mb_list_encodings</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
-->