Files
php-doc-ru/reference/intl/intlchar/isxdigit.xml
2024-01-17 09:33:16 +03:00

125 lines
3.6 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: e20e74073379710a4f6316734c42996c8fbf9beb Maintainer: rjhdby Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="intlchar.isxdigit" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>IntlChar::isxdigit</refname>
<refpurpose>Проверяет, относится ли кодовая точка к шестнадцатеричной цифре</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="IntlChar">
<modifier>public</modifier> <modifier>static</modifier> <type class="union"><type>bool</type><type>null</type></type><methodname>IntlChar::isxdigit</methodname>
<methodparam><type class="union"><type>int</type><type>string</type></type><parameter>codepoint</parameter></methodparam>
</methodsynopsis>
<para>
Проверяет, относится ли кодовая точка к шестнадцатеричной цифре.
</para>
<para>
&true; для символов общей категории «Nd» (десятичные числа),
а также латинских букв a-f и A-F как в представлениях ASCII, так и в представлении ASCII полной ширины.
(То есть для букв с кодовыми точками 0041..0046, 0061..0066, FF21..FF26, FF41..FF46.)
</para>
<para>
Эквивалентно <literal>IntlChar::digit($codepoint, 16) &gt;= 0</literal>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>codepoint</parameter></term>
<listitem>
&intl.codepoint.parameter;
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает &true;, если кодовая точка <parameter>codepoint</parameter>
это шестнадцатеричный символ, или &false; — если нет.
В случае возникновения ошибки возвращает &null;.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title>&intl.codepoint.example;</title>
<programlisting role="php">
<![CDATA[
<?php
var_dump(IntlChar::isxdigit("A"));
var_dump(IntlChar::isxdigit("1"));
var_dump(IntlChar::isxdigit("\u{2603}"));
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(true)
bool(true)
bool(false)
]]>
</screen>
</example>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
Чтобы сузить определение шестнадцатеричных цифр, принимаются только ASCII-символы:
</para>
<programlisting role="php">
<![CDATA[
<?php
$isASCIIHexadecimal = IntlChar::ord($codepoint) <= 0x7F && IntlChar::isxdigit($codepoint);
?>
]]>
</programlisting>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>IntlChar::isdigit</function></member>
<member><function>ctype_xdigit</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
-->