<?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> <refentry xml:id="intlchar.chardirection" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>IntlChar::charDirection</refname> <refpurpose>Get bidirectional category value for a code point</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <modifier>public</modifier> <modifier>static</modifier> <type>int</type><methodname>IntlChar::charDirection</methodname> <methodparam><type>mixed</type><parameter>codepoint</parameter></methodparam> </methodsynopsis> <para> Returns the bidirectional category value for the code point, which is used in the <link xlink:href="http://www.unicode.org/reports/tr9/">Unicode bidirectional algorithm (UAX #9)</link>. </para> <note> <para> Some unassigned code points have bidi values of R or AL because they are in blocks that are reserved for Right-To-Left scripts. </para> </note> </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> The bidirectional category value; one of the following constants: <simplelist> <member><constant>IntlChar::CHAR_DIRECTION_LEFT_TO_RIGHT</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_EUROPEAN_NUMBER</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_EUROPEAN_NUMBER_TERMINATOR</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_ARABIC_NUMBER</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_BLOCK_SEPARATOR</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_SEGMENT_SEPARATOR</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_WHITE_SPACE_NEUTRAL</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_OTHER_NEUTRAL</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_LEFT_TO_RIGHT_EMBEDDING</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_LEFT_TO_RIGHT_OVERRIDE</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT_ARABIC</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT_EMBEDDING</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT_OVERRIDE</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_POP_DIRECTIONAL_FORMAT</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_DIR_NON_SPACING_MARK</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_BOUNDARY_NEUTRAL</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_FIRST_STRONG_ISOLATE</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_LEFT_TO_RIGHT_ISOLATE</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT_ISOLATE</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_POP_DIRECTIONAL_ISOLATE</constant></member> <member><constant>IntlChar::CHAR_DIRECTION_CHAR_DIRECTION_COUNT</constant></member> </simplelist> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>&intl.codepoint.example;</title> <programlisting role="php"> <![CDATA[ <?php var_dump(IntlChar::charDirection("A") === IntlChar::CHAR_DIRECTION_LEFT_TO_RIGHT); var_dump(IntlChar::charDirection("\u{05E9}") === IntlChar::CHAR_DIRECTION_RIGHT_TO_LEFT); var_dump(IntlChar::charDirection("+") === IntlChar::CHAR_DIRECTION_EUROPEAN_NUMBER_SEPARATOR); var_dump(IntlChar::charDirection(".") === IntlChar::CHAR_DIRECTION_COMMON_NUMBER_SEPARATOR); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ bool(true) bool(true) bool(true) bool(true) ]]> </screen> </example> </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 -->