php-doc-en/reference/intl/intlchar/getpropertyenum.xml
Colin O'Dell 911013ce81 Add documentation for the IntlChar class and its methods.
Documentation is based on PHP 7.0.0 RC2.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337779 c90b9560-bf6c-de11-be94-00142212c4b1
2015-09-08 01:07:12 +00:00

107 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="intlchar.getpropertyenum" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>IntlChar::getPropertyEnum</refname>
<refpurpose>Get the property constant value for a given property name</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <modifier>static</modifier> <type>int</type><methodname>IntlChar::getPropertyEnum</methodname>
<methodparam><type>string</type><parameter>alias</parameter></methodparam>
</methodsynopsis>
<para>
Returns the property constant value for a given property name, as specified in the Unicode database file PropertyAliases.txt.
Short, long, and any other variants are recognized.
</para>
<para>
In addition, this function maps the synthetic names "gcm" / "General_Category_Mask" to the property
<constant>IntlChar::PROPERTY_GENERAL_CATEGORY_MASK</constant>. These names are not in PropertyAliases.txt.
</para>
<para>
This function compliments <function>IntlChar::getPropertyName</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>alias</parameter></term>
<listitem>
<para>
The property name to be matched. The name is compared using "loose matching" as described in PropertyAliases.txt.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an <literal>IntlChar::PROPERTY_</literal> constant value,
or <constant>IntlChar::PROPERTY_INVALID_CODE</constant> if the given name does not match any property.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title>&intl.property.example;</title>
<programlisting role="php">
<![CDATA[
<?php
var_dump(IntlChar::getPropertyEnum('Bidi_Class') === IntlChar::PROPERTY_BIDI_CLASS);
var_dump(IntlChar::getPropertyEnum('script') === IntlChar::PROPERTY_SCRIPT);
var_dump(IntlChar::getPropertyEnum('IDEOGRAPHIC') === IntlChar::PROPERTY_IDEOGRAPHIC);
var_dump(IntlChar::getPropertyEnum('Some made-up string') === IntlChar::PROPERTY_INVALID_CODE);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(true)
bool(true)
bool(true)
bool(true)
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>IntlChar::getPropertyName</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
-->