cvs: phpdoc /en/reference/intl .cvsignore book.xml collator-constants.xml collator.xml configure.xml constants.xml locale-constants.xml locale.xml
messageformatter.xml normalizer-constants.xml normalizer.xml numberformatter-constants.xml numberformatter.xml reference.xml
/en/reference/intl/collator asort.xml compare.xml construct.xml create.xml get-attribute.xml get-error-code.xml get-error-message.xml get-locale.xml
get-strength.xml set-attribute.xml set-strength.xml sort-with-sort-keys.xml sort.xml /en/reference/intl/functions intl-error-name.xml
intl-get-error-code.xml intl-get-error-message.xml intl-is-failure.xml /en/reference/intl/locale compose-locale.xml filter-matches.xml
get-all-variants.xml get-default.xml get-display-language.xml get-display-name.xml get-display-region.xml get-display-script.xml
get-display-variant.xml get-keywords.xml get-primary-language.xml get-region.xml get-script.xml lookup.xml parse-locale.xml set-default.xml
/en/reference/int! l/messageformatter create.xml format-message.xml format.xml get-error-code.xml get-error-message.xml get-locale.xml get-pattern.xml
parse-message.xml parse.xml set-pattern.xml /en/reference/intl/normalizer is-normalized.xml normalize.xml /en/reference/intl/numberformatter
create.xml format-currency.xml format.xml get-attribute.xml get-error-code.xml get-error-message.xml get-locale.xml get-pattern.xml get-symbol.xml
get-text-attribute.xml parse-currency.xml parse.xml set-attribute.xml set-pattern.xml set-symbol.xml set-text-attribute.xml
| From: | Stanislav Malyshev | Date: | Wed, 26 Dec 2007 20:43:37 +0000 |
| Subject: | cvs: phpdoc /en/reference/intl .cvsignore book.xml collator-constants.xml collator.xml configure.xml constants.xml locale-constants.xml locale.xml messageformatter.xml normalizer-constants.xml normalizer.xml numberformatter-constants.xml numberformatter.xml reference.xml /en/reference/intl/collator asort.xml compare.xml construct.xml create.xml get-attribute.xml get-error-code.xml get-error-message.xml get-locale.xml get-strength.xml set-attribute.xml set-strength.xml sort-with-sort-keys.xml sort.xml /en/reference/intl/functions intl-error-name.xml intl-get-error-code.xml intl-get-error-message.xml intl-is-failure.xml /en/reference/intl/locale compose-locale.xml filter-matches.xml get-all-variants.xml get-default.xml get-display-language.xml get-display-name.xml get-display-region.xml get-display-script.xml get-display-variant.xml get-keywords.xml get-primary-language.xml get-region.xml get-script.xml lookup.xml parse-locale.xml set-default.xml /en/reference/int! l/messageformatter create.xml format-message.xml format.xml get-error-code.xml get-error-message.xml get-locale.xml get-pattern.xml parse-message.xml parse.xml set-pattern.xml /en/reference/intl/normalizer is-normalized.xml normalize.xml /en/reference/intl/numberformatter create.xml format-currency.xml format.xml get-attribute.xml get-error-code.xml get-error-message.xml get-locale.xml get-pattern.xml get-symbol.xml get-text-attribute.xml parse-currency.xml parse.xml set-attribute.xml set-pattern.xml set-symbol.xml set-text-attribute.xml |
||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-855@lists.php.net to get a copy of this message | ||
stas Wed Dec 26 20:43:37 2007 UTC
Added files:
/phpdoc/en/reference/intl/collator asort.xml compare.xml
construct.xml create.xml
get-attribute.xml
get-error-code.xml
get-error-message.xml
get-locale.xml get-strength.xml
set-attribute.xml
set-strength.xml
sort-with-sort-keys.xml sort.xml
/phpdoc/en/reference/intl/locale compose-locale.xml
filter-matches.xml
get-all-variants.xml
get-default.xml
get-display-language.xml
get-display-name.xml
get-display-region.xml
get-display-script.xml
get-display-variant.xml
get-keywords.xml
get-primary-language.xml
get-region.xml get-script.xml
lookup.xml parse-locale.xml
set-default.xml
/phpdoc/en/reference/intl/messageformatter create.xml
format-message.xml
format.xml
get-error-code.xml
get-error-message.xml
get-locale.xml
get-pattern.xml
parse-message.xml
parse.xml
set-pattern.xml
/phpdoc/en/reference/intl/normalizer is-normalized.xml
normalize.xml
/phpdoc/en/reference/intl/numberformatter create.xml
format-currency.xml
format.xml
get-attribute.xml
get-error-code.xml
get-error-message.xml
get-locale.xml
get-pattern.xml
get-symbol.xml
get-text-attribute.xml
parse-currency.xml
parse.xml
set-attribute.xml
set-pattern.xml
set-symbol.xml
set-text-attribute.xml
Modified files:
/phpdoc/en/reference/intl .cvsignore book.xml
collator-constants.xml collator.xml
configure.xml constants.xml
locale-constants.xml locale.xml
messageformatter.xml
normalizer-constants.xml normalizer.xml
numberformatter-constants.xml
numberformatter.xml reference.xml
/phpdoc/en/reference/intl/functions intl-error-name.xml
intl-get-error-code.xml
intl-get-error-message.xml
intl-is-failure.xml
Log:
MFB intl docs
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/.cvsignore?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/.cvsignore diff -u /dev/null phpdoc/en/reference/intl/.cvsignore:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/.cvsignore Wed Dec 26 20:43:36 2007 @@ -0,0 +1,2 @@ +entities.*.xml +*.php http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/book.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/book.xml diff -u /dev/null phpdoc/en/reference/intl/book.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/book.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,247 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> + +<book xml:id="book.intl" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>Internationalization Functions</title> + <titleabbrev>intl</titleabbrev> + + <!-- {{{ Preface --> + <preface xml:id="intro.intl"> + &reftitle.intro; + <para> + Internationalization extension (further is referred as Intl) is a wrapper + for <link xlink:href="&url.icu.home;">ICU</link> + library, enabling PHP programmers to perform UCA-conformant collation and + date/time/number/currency formatting in their scripts. + </para> + + <para> + It tends to closely follow ICU APIs, so that people having experience + working with ICU in either C/C++ or Java could easily use the PHP API. + Also, this way ICU documentation would be useful to understand various ICU + functions. + </para> + + <para> + Intl consists of several modules, each of them exposes the corresponding + ICU API: + </para> + + <itemizedlist> + <listitem> + <simpara> + Collator: provides string comparison capability with support for + appropriate locale-sensitive sort orderings. + </simpara> + </listitem> + <listitem> + <simpara> + Number Formatter: allows to display number according to the localized + format or given pattern or set of rules, and to parse strings into + numbers. + </simpara> + </listitem> + <listitem> + <simpara> + Normalizer: provides a function to transform text into one of the Unicode + normalization forms, and provides a routine to test if a given string is + already normalized. + </simpara> + </listitem> + <listitem> + <simpara> + Locale: provides interaction with locale identifiers in the form of + functions to get subtags from locale identifier; parse, compose, + match(lookup and filter) locale identifiers. + </simpara> + </listitem> + </itemizedlist> + + <!-- {{{ Links --> + <section xml:id="intl.links"> + <title>Links</title> + <itemizedlist> + <listitem> + <para><link xlink:href="&url.icu.docs;">Miscellaneous ICU docs</link></para> + </listitem> + <listitem> + <para><link xlink:href="&url.icu.userguide;">ICU User Guide</link></para> + </listitem> + <listitem> + <para><link xlink:href="&url.icu.uca;">Unicode Collation Algorithm</link></para> + </listitem> + </itemizedlist> + </section> + <!-- }}} --> + + </preface> + <!-- }}} --> + + <!-- {{{ Setup --> + <chapter xml:id="intl.setup" xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>Installing/Configuring</title> + + <!-- {{{ Requirements --> + <section xml:id="intl.requirements"> + &reftitle.required; + <para> + To build the extension you need to install the + <link xlink:href="&url.icu.home;">ICU</link> + library of version 3.6+. + </para> + <para> + You will also need the latest version of PHP. Collator is known to work + well on PHP 5.1.3+ and 5.2.0+. + </para> + </section> + <!-- }}} --> + + <!-- {{{ Installation --> + <section xml:id="intl.installation"> + &reftitle.install; + <para> + Run: + <screen> +<![CDATA[ +$ make install +]]> + </screen> + </para> + + <para> + Then enable the extension by adding the following line to [PHP] section of + your &php.ini;: + <screen> +<![CDATA[ +extension=intl.so +]]> + </screen> + </para> + </section> + <!-- }}} --> + + <!-- {{{ Testing --> + <section xml:id="intl.testing"> + <title>Testing</title> + <para> + Run: + <screen> +<![CDATA[ +$ make test +]]> + </screen> + </para> + <para> + Note that the tests may fail if: + </para> + <itemizedlist> + <listitem> + <para> + The Collator extension is already enabled in + &php.ini; + </para> + </listitem> + <listitem> + <para> + LD_LIBRARY_PATH is used to load ICU libraries and value of the + 'variables_order' setting in php.ini doesn't contain letter 'E' (missing + 'E' means "do not register Environment variables"); + </para> + </listitem> + </itemizedlist> + </section> + <!-- }}} --> + + &reference.intl.configure; + + <!-- {{{ Resources --> + <section xml:id="intl.resources"> + &reftitle.resources; + &no.resource; + </section> + <!-- }}} --> + + </chapter> + <!-- }}} --> + + &reference.intl.constants; + + <!-- {{{ Examples --> + <appendix xml:id="intl.examples" xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.examples; + <section xml:id="intl.examples.basic"> + <title>Basic usage of this extension</title> + <para> + Each module provides two kind of APIs: a procedural one and an object + oriented one. Both are actually identical and described in the + corresponding document. + </para> + <note> + <para> + All input strings must be in UTF-8 encoding. All output strings are + also in UTF-8. + </para> + </note> + <example> + <title>Example of using the procedural API</title> + <programlisting role="php"> +<![CDATA[ +<?php +$coll = collator_create('en_US'); +$result = collator_compare($coll, "string#1", "string#2"); +?> +]]> + </programlisting> + </example> + + <example> + <title>Example of using the object-oriented API</title> + <programlisting role="php"> +<![CDATA[ +<?php +$coll = new Collator('en_US'); +$al = $coll->getLocaleByType(Locale::ACTUAL_LOCALE); +echo "Actual locale: $al\n"; + +$formatter = new NumberFormatter('en_US', NumberFormatter::DECIMAL); +echo $formatter->format(1234567); +?> +]]> + </programlisting> + </example> + </section> + </appendix> + <!-- }}} --> + + &reference.intl.reference; + + &reference.intl.collator; + &reference.intl.numberformatter; + &reference.intl.locale; + &reference.intl.normalizer; + &reference.intl.messageformatter; + +</book> + +<!-- 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:"../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator-constants.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/collator-constants.xml diff -u /dev/null phpdoc/en/reference/intl/collator-constants.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/collator-constants.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,447 @@ +<?xml version="1.0" encoding="UTF-8"?> +<section xml:id="intl.collator-constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> +<!-- $Revision: 1.2 $ --> + &reftitle.constants; + <para> + <variablelist> + <varlistentry> + <term> + <constant>Collator::FRENCH_COLLATION</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + Sort strings with different accents from the back of the string. This + attribute is automatically set to + <emphasis>On</emphasis> + for the French locales and a few others. Users normally would not need + to explicitly set this attribute. There is a string comparison + performance cost when it is set <emphasis>On</emphasis>, + but sort key length is unaffected. Possible values are: + <simplelist> + <member><constant>Collator::ON</constant></member> + <member><constant>Collator::OFF</constant>(default)</member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + <para> + <example> + <title>FRENCH_COLLATION rules</title> + <para> + <simplelist> + <member>F=OFF cote < coté < côte < côté </member> + <member>F=ON cote < côte < coté < côté</member> + </simplelist> + </para> + </example> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::ALTERNATE_HANDLING</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + The Alternate attribute is used to control the handling of the socalled + variable characters in the UCA: whitespace, punctuation and symbols. If + Alternate is set to <emphasis>NonIgnorable</emphasis> + (N), then differences among these characters are of the same importance + as differences among letters. If Alternate is set to + <emphasis>Shifted</emphasis> + (S), then these characters are of only minor importance. The + <emphasis>Shifted</emphasis> value is often used in combination with + <emphasis>Strength</emphasis> + set to Quaternary. In such a case, whitespace, punctuation, and symbols + are considered when comparing strings, but only if all other aspects of + the strings (base letters, accents, and case) are identical. If + Alternate is not set to Shifted, then there is no difference between a + Strength of 3 and a Strength of 4. For more information and examples, + see Variable_Weighting in the + <link xlink:href="&url.icu.uca;">UCA</link> + . The reason the Alternate values are not simply + <emphasis>On</emphasis> and <emphasis>Off</emphasis> + is that additional Alternate values may be added in the future. The UCA + option Blanked is expressed with Strength set to 3, and Alternate set to + Shifted. The default for most locales is NonIgnorable. If Shifted is + selected, it may be slower if there are many strings that are the same + except for punctuation; sort key length will not be affected unless the + strength level is also increased. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::NON_IGNORABLE</constant>(default)</member> + <member><constant>Collator::SHIFTED</constant></member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + <para> + <example> + <title>ALTERNATE_HANDLING rules</title> + <para> + <simplelist> + <member> + S=3, A=N di Silva < Di Silva < diSilva < U.S.A. < USA + </member> + <member> + S=3, A=S di Silva = diSilva < Di Silva < U.S.A. = USA + </member> + <member> + S=4, A=S di Silva < diSilva < Di Silva < U.S.A. < USA + </member> + </simplelist> + </para> + </example> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::CASE_FIRST</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + The Case_First attribute is used to control whether uppercase letters + come before lowercase letters or vice versa, in the absence of other + differences in the strings. The possible values are + <emphasis>Uppercase_First</emphasis> + (U) and <emphasis>Lowercase_First</emphasis> + (L), plus the standard <emphasis>Default</emphasis> + and <emphasis>Off</emphasis>. + There is almost no difference between the Off and Lowercase_First + options in terms of results, so typically users will not use + Lowercase_First: only Off or Uppercase_First. (People interested in the + detailed differences between X and L should consult the Collation + Customization). Specifying either L or U won't affect string comparison + performance, but will affect the sort key length. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::OFF</constant>(default)</member> + <member><constant>Collator::LOWER_FIRST</constant></member> + <member><constant>Collator::UPPER_FIRST</constant></member> + <member><constant>Collator:DEFAULT</constant></member> + </simplelist> + </para> + <para> + <example> + <title>CASE_FIRST rules</title> + <para> + <simplelist> + <member>C=X or C=L "china" < "China" < "denmark" < "Denmark"</member> + <member>C=U "China" < "china" < "Denmark" < "denmark"</member> + </simplelist> + </para> + </example> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::CASE_LEVEL</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + The Case_Level attribute is used when ignoring accents but not case. In + such a situation, set Strength to be <emphasis>Primary</emphasis>, + and Case_Level to be <emphasis>On</emphasis>. + In most locales, this setting is Off by default. There is a small + string comparison performance and sort key impact if this attribute is + set to be <emphasis>On</emphasis>. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::OFF</constant>(default)</member> + <member><constant>Collator::ON</constant></member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + <para> + <example> + <title>CASE_LEVEL rules</title> + <para> + <simplelist> + <member>S=1, E=X role = Role = rôle</member> + <member>S=1, E=O role = rôle < Role</member> + </simplelist> + </para> + </example> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::NORMALIZATION_MODE</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + The Normalization setting determines whether text is thoroughly + normalized or not in comparison. Even if the setting is off (which is + the default for many locales), text as represented in common usage will + compare correctly (for details, see UTN #5). Only if the accent marks + are in noncanonical order will there be a problem. If the setting is + <emphasis>On</emphasis>, + then the best results are guaranteed for all possible text input. + There is a medium string comparison performance cost if this attribute + is <emphasis>On</emphasis>, + depending on the frequency of sequences that require normalization. + There is no significant effect on sort key length. If the input text is + known to be in NFD or NFKD normalization forms, there is no need to + enable this Normalization option. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::OFF</constant>(default)</member> + <member><constant>Collator::ON</constant></member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::STRENGTH</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + The ICU Collation Service supports many levels of comparison (named + "Levels", but also known as "Strengths"). Having these categories + enables ICU to sort strings precisely according to local conventions. + However, by allowing the levels to be selectively employed, searching + for a string in text can be performed with various matching conditions. + For more detailed information, see + <function>collator_set_strength</function> chapter. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::PRIMARY</constant></member> + <member><constant>Collator::SECONDARY</constant></member> + <member><constant>Collator::TERTIARY</constant>(default)</member> + <member><constant>Collator::QUATERNARY</constant></member> + <member><constant>Collator::IDENTICAL</constant></member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::HIRAGANA_QUATERNARY_MODE</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + Compatibility with JIS x 4061 requires the introduction of an additional + level to distinguish Hiragana and Katakana characters. If compatibility + with that standard is required, then this attribute should be set + <emphasis>On</emphasis>, + and the strength set to Quaternary. This will affect sort key length + and string comparison string comparison performance. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::OFF</constant>(default)</member> + <member><constant>Collator::ON</constant></member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::NUMERIC_COLLATION</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + When turned on, this attribute generates a collation key for the numeric + value of substrings of digits. This is a way to get '100' to sort AFTER + '2'. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::OFF</constant>(default)</member> + <member><constant>Collator::ON</constant></member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::DEFAULT_VALUE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::PRIMARY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::SECONDARY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::TERTIARY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::DEFAULT_STRENGTH</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::QUATERNARY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::IDENTICAL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::OFF</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::ON</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::SHIFTED</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::NON_IGNORABLE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::LOWER_FIRST</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::UPPER_FIRST</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + </variablelist> + </para> +</section> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/collator.xml diff -u /dev/null phpdoc/en/reference/intl/collator.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/collator.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> + +<reference xml:id="class.collator" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>The Collator class</title> + <titleabbrev>Collator</titleabbrev> + + <partintro> + + <!-- {{{ Collator intro --> + <section xml:id="collator.intro"> + &reftitle.intro; + <para> + Provides string comparison capability with support for appropriate + locale-sensitive sort orderings. + </para> + </section> + <!-- }}} --> + + <section xml:id="collator.synopsis"> + <title>Class synopsis</title> + + <!-- {{{ Synopsis --> + <classsynopsis> + <ooclass> + <classname>Collator</classname> + </ooclass> + + <!-- {{{ Class synopsis --> + <!-- + <classsynopsisinfo> + <ooclass> + <classname>Collator</classname> + </ooclass> + </classsynopsisinfo> + --> + <!-- }}} --> + + <!-- + <classsynopsisinfo role="comment">Properties</classsynopsisinfo> + <fieldsynopsis> + <modifier>public</modifier> + <type>string</type> + <varname linkend="collator.props.name">name</varname> + </fieldsynopsis> + + <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.collator')/db:refentry/db:refsect1[@role='description']/descendant::db:fieldsynopsis[1])" /> + --> + + <classsynopsisinfo role="comment">Methods</classsynopsisinfo> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.collator')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" /> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.collator')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> + </classsynopsis> + <!-- }}} --> + + </section> + + <!-- {{{ Collator properties + <section xml:id="collator.props"> + &reftitle.properties; + <variablelist> + <varlistentry xml:id="collator.props.name"> + <term><varname>name</varname></term> + <listitem> + <para>Prop description</para> + </listitem> + </varlistentry> + </variablelist> + </section> + }}} --> + + &reference.intl.collator-constants; + </partintro> + + &reference.intl.entities.collator; + +</reference> + +<!-- 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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/configure.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/configure.xml diff -u /dev/null phpdoc/en/reference/intl/configure.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/configure.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<section xml:id="intl.building" xmlns="http://docbook.org/ns/docbook"> + <title>Building</title> + + <para> + Let's assume that you have installed PHP to + <emphasis>/opt/php5/</emphasis> + and ICU is installed to + <emphasis>/opt/icu/</emphasis>. Run the following commands: + </para> + <screen> +<![CDATA[ +$ /opt/php5/bin/phpize +$ ./configure --with-php-config=/opt/php5/bin/php-config --with-icu-dir=/opt/icu +$ make +]]> + </screen> + <para> + If your ICU is installed to a non-standard directory then you might want to + specify its location in + <constant>LD_LIBRARY_PATH</constant> + environment variable so that dynamic linker can find it: + </para> + <screen>$ export LD_LIBRARY_PATH=/opt/icu/lib</screen> + <para> + Otherwise, if PHP and ICU are installed to their default locations, then the + additional options to `configure' are not needed. + </para> +</section> + +<!-- 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:"../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/constants.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/constants.xml diff -u /dev/null phpdoc/en/reference/intl/constants.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/constants.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<appendix xml:id="intl.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.constants; + &no.constants; +</appendix> + +<!-- 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:"../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale-constants.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/locale-constants.xml diff -u /dev/null phpdoc/en/reference/intl/locale-constants.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/locale-constants.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<section xml:id="intl.locale-constants" xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.constants; + <para> + These constants define how the Locale + <variablelist> + <varlistentry> + <term> + <constant>Locale::DEFAULT_LOCALE</constant> + (<type>string</type>) + </term> + <listitem> + <simpara> + Used with the getLocale methods of the various locale affected classes, + such as numfmt. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::ACTUAL_LOCALE</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>This is locale the data actually comes from.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::VALID_LOCALE</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>This is the most specific locale supported by ICU.</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + + <section xml:id="intl.locale-constants.subtags"> + <para> + These constants define how the Locales are parsed or composed. They should + be used as keys in the argument array to <function>locale_compose</function> + and are returned from <function>locale_parse</function> + as keys of the returned associative <type>array</type>. + <variablelist> + <varlistentry> + <term> + <constant>Locale::LANG_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Language subtag</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::EXTLANG_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Extended language subtag</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::SCRIPT_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Script subtag</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term> + <constant>Locale::REGION_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Region subtag</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::VARIANT_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Variant subtag</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::GRANDFATHERED_LANG_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Grandfathered Language subtag</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::PRIVATE_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Private subtag</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> +</section> + +<!-- 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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/locale.xml diff -u /dev/null phpdoc/en/reference/intl/locale.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/locale.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<reference xml:id="class.locale" xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>The Locale class</title> + <titleabbrev>Locale</titleabbrev> + + <partintro> + + <!-- {{{ Locale intro --> + <section xml:id="locale.intro"> + &reftitle.intro; + <simpara> + A "Locale" is an identifier used to get language, culture, or + regionally-specific behavior from an API. PHP locales are organized and + identified the same way that the CLDR locales used by ICU (and many + vendors of Unix-like operating systems, the Mac, Java, and so forth) use. + Locales are identified using RFC 4646 language tags (which use hyphen, not + underscore) in addition to the more traditional underscore-using + identifiers. Unless otherwise noted the functions in this class are + tolerant of both formats. + </simpara> + <para> + Examples of identifiers include: + <simplelist> + <member>en-US (English, United States)</member> + <member>zh-Hant-TW (Chinese, Traditional Script, Taiwan)</member> + <member>fr-CA, fr-FR (French for Canada and France respectively)</member> + </simplelist> + </para> + <simpara> + The Locale class (and related procedural functions) are used to interact + with locale identifiers--to verify that an ID is well-formed, valid, etc. + The extensions used by CLDR in UAX #35 (and inherited by ICU) are valid + and used wherever they would be in ICU normally. + </simpara> + <simpara> + Locales cannot be instantiated as objects. All of the functions/methods + provided are static. + </simpara> + <simpara> + The null or empty string obtains the "root" locale. The "root" locale is + equivalent to "en_US_POSIX" in CLDR. Language tags (and thus locale + identifiers) are case insensitive. There exists a canonicalization + function to make case match the specification. + </simpara> + </section> + <!-- }}} --> + + <section xml:id="locale.synopsis"> + <title>Class synopsis</title> + + <!-- {{{ Synopsis --> + <classsynopsis> + <ooclass> + <classname>Locale</classname> + </ooclass> + + <!-- {{{ Class synopsis --> + <!-- + <classsynopsisinfo> + <ooclass> + <classname>Locale</classname> + </ooclass> + </classsynopsisinfo> + --> + <!-- }}} --> + + <!-- + <classsynopsisinfo role="comment">Properties</classsynopsisinfo> + <fieldsynopsis> + <modifier>public</modifier> + <type>string</type> + <varname linkend="locale.props.name">name</varname> + </fieldsynopsis> + + <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.Locale')/db:refentry/db:refsect1[@role='description']/descendant::db:fieldsynopsis[1])" /> + --> + + <classsynopsisinfo role="comment">Methods</classsynopsisinfo> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.locale')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> + </classsynopsis> + <!-- }}} --> + + </section> + + <!-- {{{ Locale properties + <section xml:id="Locale.props"> + &reftitle.properties; + <variablelist> + <varlistentry xml:id="locale.props.name"> + <term><varname>name</varname></term> + <listitem> + <para>Prop description</para> + </listitem> + </varlistentry> + </variablelist> + </section> + }}} --> + + &reference.intl.locale-constants; + <section xml:id="locale.seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member> + <link xlink:href="&url.rfc;4646"> + RFC 4646 - Tags for Identifying Languages + </link> + </member> + <member> + <link xlink:href="&url.rfc;4647"> + RFC 4647 - Matching of Language Tags + </link> + </member> + <member> + <link xlink:href="&url.cldr.locale;"> + Unicode CLDR Project:Common Locale Data Repository + </link> + </member> + <member> + <link xlink:href="&url.iana.locale.subtags;"> + IANA Language Subtags Registry + </link> + </member> + <member> + <link xlink:href="&url.icu.locale.guide;">ICU User Guide - Locale</link> + </member> + <member> + <link xlink:href="&url.icu.locale.api;">ICU Locale api</link> + </member> + </simplelist> + </para> + </section> + </partintro> + + &reference.intl.entities.locale; + +</reference> + +<!-- 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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/messageformatter.xml diff -u /dev/null phpdoc/en/reference/intl/messageformatter.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/messageformatter.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<reference xml:id="class.messageformatter" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>The MessageFormatter class</title> + <titleabbrev>MessageFormatter</titleabbrev> + + <partintro> + + <!-- {{{ MessageFormatter intro --> + <section xml:id="messageformatter.intro"> + &reftitle.intro; + <simpara> + MessageFormatter is a concrete class that enables users to produce + concatenated, language-neutral messages. The methods supplied in this + class are used to build all the messages that are seen by end users. + </simpara> + <simpara> + The MessageFormatter class assembles messages from various fragments (such + as text fragments, numbers, and dates) supplied by the program. Because of + the MessageFormatter class, the program does not need to know the order of + the fragments. The class uses the formatting specifications for the + fragments to assemble them into a message that is contained in a single + string within a resource bundle. For example, MessageFormatter enables you + to print the phrase "Finished printing x out of y files..." in a manner + that still allows for flexibility in translation. + </simpara> + <simpara> + Previously, an end user message was created as a sentence and handled as a + string. This procedure created problems for localizers because the + sentence structure, word order, number format and so on are very different + from language to language. The language-neutral way to create messages + keeps each part of the message separate and provides keys to the data. + Using these keys, the MessageFormatter class can concatenate the parts of + the message, localize them, and display a well-formed string to the end + user. + </simpara> + <simpara> + MessageFormatter takes a set of objects, formats them, and then inserts + the formatted strings into the pattern at the appropriate places. Choice + formats can be used in conjunction with MessageFormatter to handle + plurals, match numbers, and select from an array of items. Typically, the + message format will come from resources and the arguments will be + dynamically set at runtime. + </simpara> + </section> + <!-- }}} --> + + <section xml:id="messageformatter.synopsis"> + <title>Class synopsis</title> + + <!-- {{{ Synopsis --> + <classsynopsis> + <ooclass> + <classname>MessageFormatter</classname> + </ooclass> + + <!-- {{{ Class synopsis --> + <!-- }}} --> + + <classsynopsisinfo role="comment">Methods</classsynopsisinfo> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.messageformatter')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" /> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.messageformatter')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> + </classsynopsis> + <!-- }}} --> + + </section> + + <section xml:id="messageformatter.seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member> + <link xlink:href="&url.icu.formatparse;"> + ICU formatting documentation + </link> + </member> + <member> + <link xlink:href="&url.icu.formatmsg;"> + ICU message formatting description + </link> + </member> + <member> + <link xlink:href="&url.icu.msgformat;">ICU message formatters</link> + </member> + <member> + <link xlink:href="&url.icu.choiceformat;">ICU choice formatters</link> + </member> + </simplelist> + </para> + </section> + </partintro> + + &reference.intl.entities.messageformatter; + +</reference> + +<!-- 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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/normalizer-constants.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/normalizer-constants.xml diff -u /dev/null phpdoc/en/reference/intl/normalizer-constants.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/normalizer-constants.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<section xml:id="intl.normalizer-constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.constants; + + <para> + The following constants define the normalization form used by the + normalizer: + <variablelist> + <varlistentry> + <term> + <constant>Normalizer::FORM_C</constant> + (<type>string</type>) + </term> + <listitem> + <simpara> + Normalization Form C (NFC) - Canonical Decomposition followed by + Canonical Composition + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Normalizer::FORM_D</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Normalization Form D (NFD) - Canonical Decomposition</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Normalizer::FORM_KC</constant> + (<type>string</type>) + </term> + <listitem> + <simpara> + Normalization Form KC (NFKC) - Compatibility Decomposition, followed by + Canonical Composition + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Normalizer::FORM_KD</constant> + (<type>string</type>) + </term> + <listitem> + <simpara> + Normalization Form KD (NFKD) - Compatibility Decomposition + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Normalizer::NONE</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>No decomposition/composition</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Normalizer::OPTION_DEFAULT</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Default normalization options</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> +</section> + +<!-- 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:"../../../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 +--> + http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/normalizer.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/normalizer.xml diff -u /dev/null phpdoc/en/reference/intl/normalizer.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/normalizer.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<reference xml:id="class.normalizer" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>The Normalizer class</title> + <titleabbrev>Normalizer</titleabbrev> + + <partintro> + + <!-- {{{ Normalizer intro --> + <section xml:id="normalizer.intro"> + &reftitle.intro; + <simpara> + Normalization is a process that involves transforming characters and + sequences of characters into a formally-defined underlying representation. + This process is most important when text needs to be compared for sorting + and searching, but it is also used when storing text to ensure that the + text is stored in a consistent representation. + </simpara> + <para> + The Unicode Consortium has defined a number of normalization forms + reflecting the various needs of applications: + <simplelist> + <member>Normalization Form D (NFD) - Canonical Decomposition</member> + <member> + Normalization Form C (NFC) - Canonical Decomposition followed by + Canonical Composition + </member> + <member> + Normalization Form KD (NFKD) - Compatibility Decomposition + </member> + <member> + Normalization Form KC (NFKC) - Compatibility Decomposition followed by + Canonical Composition + </member> + </simplelist> + The different forms are defined in terms of a set of transformations on + the text, transformations that are expressed by both an algorithm and a + set of data files. + </para> + </section> + <!-- }}} --> + + <section xml:id="normalizer.synopsis"> + <title>Class synopsis</title> + + <!-- {{{ Synopsis --> + <classsynopsis> + <ooclass> + <classname>Normalizer</classname> + </ooclass> + + <!-- {{{ Class synopsis --> + <!-- + <classsynopsisinfo> + <ooclass> + <classname>Normalizer</classname> + </ooclass> + </classsynopsisinfo> + --> + <!-- }}} --> + + <!-- + <classsynopsisinfo role="comment">Properties</classsynopsisinfo> + <fieldsynopsis> + <modifier>public</modifier> + <type>string</type> + <varname linkend="normalizer.props.name">name</varname> + </fieldsynopsis> + + <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.normalizer')/db:refentry/db:refsect1[@role='description']/descendant::db:fieldsynopsis[1])" /> + --> + + <classsynopsisinfo role="comment">Methods</classsynopsisinfo> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.normalizer')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> + </classsynopsis> + <!-- }}} --> + + </section> + + <!-- {{{ Normalizer properties + <section xml:id="Normalizer.props"> + &reftitle.properties; + <variablelist> + <varlistentry xml:id="normalizer.props.name"> + <term><varname>name</varname></term> + <listitem> + <para>Prop description</para> + </listitem> + </varlistentry> + </variablelist> + </section> + }}} --> + + &reference.intl.normalizer-constants; + + <section xml:id="normalizer.seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member> + <link xlink:href="&url.unicode.normalization;"> + Unicode Normalization + </link> + </member> + <member> + <link xlink:href="&url.unicode.normalization.faq;"> + Unicode Normalization FAQ + </link> + </member> + <member> + <link xlink:href="&url.icu.normalization.guide;"> + ICU User Guide - Normalization + </link> + </member> + <member> + <link xlink:href="&url.icu.normalization.api;"> + ICU API Reference - Normalization + </link> + </member> + </simplelist> + </para> + </section> + </partintro> + + &reference.intl.entities.normalizer; + +</reference> + +<!-- 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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter-constants.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/numberformatter-constants.xml diff -u /dev/null phpdoc/en/reference/intl/numberformatter-constants.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/numberformatter-constants.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,848 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Revision: 1.2 $ --> +<section xml:id="intl.numberformatter-constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.constants; + + <section xml:id="intl.numberformatter-constants.UNumberFormatStyle"> + <para> + These styles are used by the <function>numfmt_create</function> + to define the type of the formatter. + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::PATTERN_DECIMAL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Decimal format defined by pattern</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::DECIMAL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Decimal format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::CURRENCY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Currency format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PERCENT</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Percent format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::SCIENTIFIC</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Scientific format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::SPELLOUT</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Spellout rule-based format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ORDINAL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Ordinal rule-based format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::DURATION</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Duration rule-based format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PATTERN_RULEBASED</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rule-based format defined by pattern</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::DEFAULT_STYLE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Default format for the locale</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::IGNORE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Alias for PATTERN_DECIMAL</simpara> + </listitem> + </varlistentry> + </variablelist> + + + + + + </para> + </section> + + <section xml:id="intl.numberformatter-constants.types"> + <para> + These constants define how the numbers are parsed or formatted. They should + be used as arguments to <function>numfmt_format</function> + and <function>numfmt_parse</function>. + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::TYPE_DEFAULT</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Derive the type from variable type</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::TYPE_INT32</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Format/parse as 32-bit integer</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::TYPE_INT64</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Format/parse as 64-bit integer</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::TYPE_DOUBLE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Format/parse as floating point value</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::TYPE_CURRENCY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Format/parse as currency value</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> + + <section xml:id="intl.numberformatter-constants.UNumberFormatAttribute"> + <para> + Number format attribute used by + <function>numfmt_get_attribute</function> + and + <function>numfmt_set_attribute</function> + . + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::PARSE_INT_ONLY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Parse integers only.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::GROUPING_USED</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Use grouping separator.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::DECIMAL_ALWAYS_SHOWN</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Always show decimal point.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MAX_INTEGER_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Maximum integer digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MIN_INTEGER_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Minimum integer digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::INTEGER_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Integer digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MAX_FRACTION_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Maximum fraction digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MIN_FRACTION_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Minimum fraction digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::FRACTION_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Fraction digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MULTIPLIER</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Multiplier.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::GROUPING_SIZE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Grouping size.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUNDING_MODE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rounding Mode.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUNDING_INCREMENT</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rounding increment.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::FORMAT_WIDTH</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The width to which the output of format() is padded.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PADDING_POSITION</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + The position at which padding will take place. See pad position + constants for possible argument values. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::SECONDARY_GROUPING_SIZE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Secondary grouping size.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::SIGNIFICANT_DIGITS_USED</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Use significant digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MIN_SIGNIFICANT_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Minimum significant digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MAX_SIGNIFICANT_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Maximum significant digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::LENIENT_PARSE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Lenient parse mode used by rule-based formats.</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> + + <section + xml:id="intl.numberformatter-constants.UNumberFormatTextAttribute"> + <para> + Number format text attribute used by + <function>numfmt_get_text_attribute</function> and + <function>numfmt_set_text_attribute</function>. + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::POSITIVE_PREFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Positive prefix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::POSITIVE_SUFFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Positive suffix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::NEGATIVE_PREFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Negative prefix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::NEGATIVE_SUFFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Negative suffix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PADDING_CHARACTER</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The character used to pad to the format width.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::CURRENCY_CODE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The ISO currency code.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::DEFAULT_RULESET</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + The default rule set. This is only available with rule-based + formatters. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PUBLIC_RULESETS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + The public rule sets. This is only available with rule-based + formatters. This is a read-only attribute. The public rulesets are + returned as a single string, with each ruleset name delimited by ';' + (semicolon). + </simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> + + <section xml:id="intl.numberformatter-constants.UNumberFormatSymbol"> + <para> + Number format symbols used by <function>numfmt_get_symbol</function> + and <function>numfmt_set_symbol</function>. + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::DECIMAL_SEPARATOR_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The decimal separator.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::GROUPING_SEPARATOR_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The grouping separator.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PATTERN_SEPARATOR_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The pattern separator.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PERCENT_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The percent sign.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ZERO_DIGIT_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Zero.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::DIGIT_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Character representing a digit in the pattern.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MINUS_SIGN_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The minus sign.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PLUS_SIGN_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The plus sign.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::CURRENCY_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The currency symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::INTL_CURRENCY_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The international currency symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MONETARY_SEPARATOR_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The monetary separator.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::EXPONENTIAL_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The exponential symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PERMILL_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Per mill symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PAD_ESCAPE_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Escape padding character.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::INFINITY_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Infinity symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::NAN_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Not-a-number symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Significant digit symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The monetary grouping separator.</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> + + <section xml:id="intl.numberformatter-constants.UNumberFormatRoundingMode"> + <para> + Rounding mode values used by <function>numfmt_get_attribute</function> + and <function>numfmt_set_attribute</function> with + <constant>NumberFormatter::ROUNDING_MODE</constant> attribute. + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_CEILING</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rounding mode to round towards positive infinity.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_DOWN</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rounding mode to round towards zero.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_FLOOR</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rounding mode to round towards negative infinity.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_HALFDOWN</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + Rounding mode to round towards "nearest neighbor" unless both neighbors + are equidistant, in which case round down. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_HALFEVEN</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + Rounding mode to round towards the "nearest neighbor" unless both + neighbors are equidistant, in which case, round towards the even + neighbor. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_HALFUP</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + Rounding mode to round towards "nearest neighbor" unless both neighbors + are equidistant, in which case round up. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_UP</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rounding mode to round away from zero.</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> + + <section xml:id="intl.numberformatter-constants.UNumberFormatPadPosition"> + <para> + Pad position values used by <function>numfmt_get_attribute</function> + and <function>numfmt_set_attribute</function> with + <constant>NumberFormatter::PADDING_POSITION</constant> attribute. + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::PAD_AFTER_PREFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Pad characters inserted after the prefix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PAD_AFTER_SUFFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Pad characters inserted after the suffix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PAD_BEFORE_PREFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Pad characters inserted before the prefix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PAD_BEFORE_SUFFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Pad characters inserted before the suffix.</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> + +</section> + +<!-- 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:"../../../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 +--> + http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/numberformatter.xml diff -u /dev/null phpdoc/en/reference/intl/numberformatter.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/numberformatter.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<reference xml:id="class.numberformatter" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>The NumberFormatter class</title> + <titleabbrev>NumberFormatter</titleabbrev> + + <partintro> + + <!-- {{{ NumberFormatter intro --> + <section xml:id="numberformatter.intro"> + &reftitle.intro; + <simpara> + Programs store and operate on numbers using a locale-independent binary + representation. When displaying or printing a number it is converted to a + locale-specific string. For example, the number 12345.67 is "12,345.67" in + the US, "12 345,67" in France and "12.345,67" in Germany. + </simpara> + <simpara> + By invoking the methods provided by the NumberFormatter class, you can + format numbers, currencies, and percentages according to the specified or + default locale. NumberFormatter is locale-sensitive so you need to create + a new NumberFormatter for each locale. NumberFormatter methods format + primitive-type numbers, such as double and output the number as a + locale-specific string. + </simpara> + <para> + For currencies you can use currency format type to create a formatter that + returns a string with the formatted number and the appropriate currency + sign. Of course, the NumberFormatter class is unaware of exchange rates + so, the number output is the same regardless of the specified currency. + This means that the same number has different monetary values depending on + the currency locale. If the number is 9988776.65 the results will be: + <simplelist> + <member>9 988 776,65 ⬠in France</member> + <member>9.988.776,65 ⬠in Germany</member> + <member>$9,988,776.65 in the United States</member> + </simplelist> + </para> + <simpara> + In order to format percentages, create a locale-specific formatter with + percentage format type. With this formatter, a decimal fraction such as + 0.75 is displayed as 75%. + </simpara> + <simpara> + For more complex formatting, like spelled-out numbers, the rule-based + number formatters are used. + </simpara> + </section> + <!-- }}} --> + + <section xml:id="NumberFormatter.synopsis"> + <title>Class synopsis</title> + + <!-- {{{ Synopsis --> + <classsynopsis> + <ooclass> + <classname>NumberFormatter</classname> + </ooclass> + + <!-- {{{ Class synopsis --> + <!-- + <classsynopsisinfo> + <ooclass> + <classname>NumberFormatter</classname> + </ooclass> + </classsynopsisinfo> + --> + <!-- }}} --> + + <!-- + <classsynopsisinfo role="comment">Properties</classsynopsisinfo> + <fieldsynopsis> + <modifier>public</modifier> + <type>string</type> + <varname linkend="NumberFormatter.props.name">name</varname> + </fieldsynopsis> + + <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.NumberFormatter')/db:refentry/db:refsect1[@role='description']/descendant::db:fieldsynopsis[1])" /> + --> + + <classsynopsisinfo role="comment">Methods</classsynopsisinfo> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.numberformatter')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> + </classsynopsis> + <!-- }}} --> + + </section> + + <!-- {{{ NumberFormatter properties + <section xml:id="NumberFormatter.props"> + &reftitle.properties; + <variablelist> + <varlistentry xml:id="NumberFormatter.props.name"> + <term><varname>name</varname></term> + <listitem> + <para>Prop description</para> + </listitem> + </varlistentry> + </variablelist> + </section> + }}} --> + + &reference.intl.numberformatter-constants; + + <section xml:id="numberformatter.seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member> + <link xlink:href="&url.icu.formatparse;"> + ICU formatting documentation + </link> + </member> + <member> + <link xlink:href="&url.icu.formatnumbers;">ICU number formatters</link> + </member> + <member> + <link xlink:href="&url.icu.decimalformat;">ICU decimal formatters</link> + </member> + <member> + <link xlink:href="&url.icu.ruleformat;"> + ICU rule-based number formatters + </link> + </member> + </simplelist> + </para> + </section> + </partintro> + + &reference.intl.entities.numberformatter; + +</reference> + +<!-- 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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/reference.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/reference.xml diff -u /dev/null phpdoc/en/reference/intl/reference.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/reference.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<reference xml:id="ref.intl" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>intl &Functions;</title> + &reference.intl.entities.functions; +</reference> + +<!-- 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:"../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/functions/intl-error-name.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/functions/intl-error-name.xml diff -u /dev/null phpdoc/en/reference/intl/functions/intl-error-name.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/functions/intl-error-name.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<refentry xml:id="function.intl-error-name"> + <refnamediv> + <refname>intl_error_name</refname> + <refpurpose>Get symbolic name for a given error code</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type> + <methodname>intl_error_name</methodname> + <methodparam><type>integer</type><parameter>error_code</parameter></methodparam> + </methodsynopsis> + <para> + Return ICU error code name. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>error_code</parameter></term> + <listitem> + <para> + ICU error code. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The returned string will be the same as the name of the error code + constant. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>intl_error_name</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$coll = collator_create( 'en_RU' ); +$err_code = collator_get_error_code( $coll ); + +printf( "Symbolic name for %d is %s\n.", $err_code, intl_error_name( $err_code ) ); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +Symbolic name for -128 is U_USING_FALLBACK_WARNING. +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>intl_is_failure</function></member> + <member><function>intl_get_error_code</function></member> + <member><function>intl_get_error_message</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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/functions/intl-get-error-code.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/functions/intl-get-error-code.xml diff -u /dev/null phpdoc/en/reference/intl/functions/intl-get-error-code.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/functions/intl-get-error-code.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Revision: 1.2 $ --> +<refentry xml:id="function.intl-get-error-code"> + <refnamediv> + <refname>intl_get_error_code</refname> + <refpurpose>Get the last error code</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>integer</type> + <methodname>intl_get_error_code</methodname> + <void /> + </methodsynopsis> + <para> + Useful to handle errors occured in static methods when there's no object to + get error code from. + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Error code returned by the last API function call. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>intl_get_error_code</function> example</title> + <programlisting role="php"> + <![CDATA[ +<?php +$coll = collator_create( '<bad_param>' ); +if( !$coll ) { + handle_error( intl_get_error_code() ); +} +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>intl_is_failure</function></member> + <member><function>intl_error_name</function></member> + <member><function>intl_get_error_message</function></member> + <member><function>collator_get_error_code</function></member> + <member><function>numfmt_get_error_code</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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/functions/intl-get-error-message.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/functions/intl-get-error-message.xml diff -u /dev/null phpdoc/en/reference/intl/functions/intl-get-error-message.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/functions/intl-get-error-message.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Revision: 1.2 $ --> +<refentry xml:id="function.intl-get-error-message"> + <refnamediv> + <refname>intl_get_error_message</refname> + <refpurpose>Get description of the last error</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type> + <methodname>intl_get_error_message</methodname> + <void /> + </methodsynopsis> + <para> + Get error message from last internationalization function called. + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Description of an error occurred in the last API function call. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>intl_get_error_message</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +if( Collator::getAvailableLocales() === false ) { + show_error( intl_get_error_message() ); +} +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>intl_error_name</function></member> + <member><function>intl_get_error_code</function></member> + <member><function>intl_is_failure</function></member> + <member><function>collator_get_error_message</function></member> + <member><function>numfmt_get_error_message</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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/functions/intl-is-failure.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/functions/intl-is-failure.xml diff -u /dev/null phpdoc/en/reference/intl/functions/intl-is-failure.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/functions/intl-is-failure.xml Wed Dec 26 20:43:37 2007 @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Revision: 1.2 $ --> +<refentry xml:id="function.intl-is-failure"> + <refnamediv> + <refname>intl_is_failure</refname> + <refpurpose>Check whether the given error code indicates failure</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type> + <methodname>intl_is_failure</methodname> + <methodparam><type>integer</type><parameter>error_code</parameter></methodparam> + </methodsynopsis> + <para> + <!-- description goes here --> + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>error_code</parameter></term> + <listitem> + <para> + is a value that returned by functions: + <function>intl_get_error_code</function>, + <function>collator_get_error_code</function> . + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &true; if it the code indicates some failure, and &false; + in case of success or a warning. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>intl_is_failure</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +function check( $err_code ) +{ + var_export( intl_is_failure( $err_code ) ); + echo "\n"; +} + +check( U_ZERO_ERROR ); +check( U_USING_FALLBACK_WARNING ); +check( U_ILLEGAL_ARGUMENT_ERROR ); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +false +false +true +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>intl_get_error_code</function></member> + <member><function>collator_get_error_code</function></member> + <member><function>Collator-getErrorCode</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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/asort.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/asort.xml +++ phpdoc/en/reference/intl/collator/asort.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.asort" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::asort</refname> <refname>collator_asort</refname> <refpurpose>Sort array maintaining index association</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Object oriented style</para> <methodsynopsis> <type>bool</type> <methodname>Collator::asort</methodname> <methodparam><type>array</type><parameter>arr</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>sort_flag</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>collator_asort</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>array</type><parameter>arr</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>sort_flag</parameter></methodparam> </methodsynopsis> <para> This function sorts an array such that array indices maintain their correlation with the array elements they are associated with. This is used mainly when sorting associative arrays where the actual element order is significant. Array elements will have sort order according to current locale rules. </para> <para> Equivalent to standard PHP <function>asort</function>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>arr</parameter></term> <listitem> <para>Array of strings to sort.</para> </listitem> </varlistentry> <varlistentry> <term><parameter>sort_flag</parameter></term> <listitem> <para> Optional sorting type, one of the following: <itemizedlist> <listitem> <para> <constant>Collator::SORT_REGULAR</constant> - compare items normally (don't change types) </para> </listitem> <listitem> <para> <constant>Collator::SORT_NUMERIC</constant> - compare items numerically </para> </listitem> <listitem> <para> <constant>Collator::SORT_STRING</constant> - compare items as strings </para> </listitem> </itemizedlist> </para> <para> Default $sort_flag value is <constant>Collator::SORT_REGULAR</constant>. It is also used if an invalid $sort_flag value has been specified. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_asort</function>example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US' ); $arr = array( 'a' => '100', 'b' => '50', 'c' => '7' ); collator_asort( $coll, $arr, Collator::SORT_NUMERIC ); var_export( $arr ); collator_asort( $coll, $arr, Collator::SORT_STRING ); var_export( $arr ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ array ( 'c' => '7', 'b' => '50', 'a' => '100', )array ( 'a' => '100', 'b' => '50', 'c' => '7', ) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname>constants</link></member> <member><function>collator_sort</function></member> <member><function>collator_sort_with_sort_keys</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/compare.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/compare.xml +++ phpdoc/en/reference/intl/collator/compare.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.compare" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::compare</refname> <refname>collator_compare</refname> <refpurpose>Compare two Unicode strings</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Collator</classname> </ooclass> <methodsynopsis> <type>integer</type> <methodname>compare</methodname> <methodparam><type>string</type><parameter>str1</parameter></methodparam> <methodparam><type>string</type><parameter>str2</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>collator_compare</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>string</type><parameter>str1</parameter></methodparam> <methodparam><type>string</type><parameter>str2</parameter></methodparam> </methodsynopsis> <para> Compare two Unicode strings according to collation rules. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>str1</parameter></term> <listitem> <para> The first string to compare. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>str2</parameter></term> <listitem> <para> The second string to compare. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para>Return comparison result:</para> <para> <itemizedlist> <listitem> <para> 1 if <emphasis> str1</emphasis> is <emphasis> greater</emphasis> than <emphasis> str2</emphasis> ; </para> </listitem> <listitem> <para> 0 if <emphasis>str1</emphasis> is <emphasis>equal</emphasis> to <emphasis> str2</emphasis>; </para> </listitem> <listitem> <para> -1 if <emphasis> str1</emphasis> is <emphasis> less</emphasis> than <emphasis> str2</emphasis> . </para> </listitem> </itemizedlist> On error <type>boolean</type> &false; is returned. </para> &return.falseproblem; </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_compare</function>example</title> <programlisting role="php"> <![CDATA[ <?php $s1 = 'Hello'; $s2 = 'hello'; $coll = collator_create( 'en_US' ); $res = collator_compare( $coll, $s1, $s2 ); if ($res === false) { echo collator_get_error_message( $coll ); } else if( $res > 0 ) { echo "s1 is greater than s2\n"; } else if( $res < 0 ) { echo "s1 is less than s2\n"; } else { echo "s1 is equal to s2\n"; ?> ]]> </programlisting> &example.outputs; <screen> s1 is greater than s2 </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>collator_sort</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/construct.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/construct.xml +++ phpdoc/en/reference/intl/collator/construct.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>Collator::__construct</refname> <refpurpose>Create a collator</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <constructorsynopsis> <methodname>Collator::__construct</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </constructorsynopsis> <para> Creates a new instance of Collator. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale whose collation rules should be used. Special values for locales can be passed in - if null is passed for the locale, the default locale collation rules will be used. If empty string ("") or "root" are passed, UCA rules will be used. </para> <para> The Locale attribute is typically the most important attribute for correct sorting and matching, according to the user expectations in different countries and regions. The default <link xlink:href="&url.icu.uca;">UCA</link> ordering will only sort a few languages such as Dutch and Portuguese correctly ("correctly" meaning according to the normal expectations for users of the languages). Otherwise, you need to supply the locale to UCA in order to properly collate text for a given language. Thus a locale needs to be supplied so as to choose a collator that is correctly tailored for that locale. The choice of a locale will automatically preset the values for all of the attributes to something that is reasonable for that locale. Thus most of the time the other attributes do not need to be explicitly set. In some cases, the choice of locale will make a difference in string comparison performance and/or sort key length. <!-- In short attribute names, <language>_<script>_<region>_<keyword> is represented by: L<language>_Z<script>_R<region>_V<variant>_K<keyword>. for <emphasis>RFC4646</emphasis> locale naming. <example><title>Locale format</title> Example: Locale="sv" (Swedish) "Kypper" < "Köpfe" Locale="de" (German) "Köpfe" < "Kypper" </example> --> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns Collator instance. </para> </refsect1> <refsect1 role="errors"> &reftitle.errors; <para> Returns an "empty" object on error. You can use <function>intl_get_error_code</function> and/or <function>intl_get_error_message</function> to know what happened. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>Collator::__construct</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = new Collator( 'en_CA' ); ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>Collator::create</function></member> <member><function>collator_create</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/create.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/create.xml +++ phpdoc/en/reference/intl/collator/create.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.create" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::create</refname> <refname>collator_create</refname> <refpurpose>Create a collator</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Object oriented style</para> <methodsynopsis> <modifier>static</modifier> <type>Collator</type> <methodname>Collator::create</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>Collator</type> <methodname>collator_create</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> The strings will be compared using the options already specified. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale containing the required collation rules. Special values for locales can be passed in - if null is passed for the locale, the default locale collation rules will be used. If empty string ("") or "root" are passed, UCA rules will be used. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Return new instance of <classname>Collator</classname> object, or &null; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_create</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US' ); if( !isset( $coll ) ) { printf( "Collator creation failed: %s\n", intl_get_error_message() ); exit( 1 ); } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>Collator::__construct</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/get-attribute.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/get-attribute.xml +++ phpdoc/en/reference/intl/collator/get-attribute.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.getattribute" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::getAttribute</refname> <refname>collator_get_attribute</refname> <refpurpose>Get collation attribute value</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>integer</type> <methodname>Collator::getAttribute</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>collator_get_attribute</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> <para> Get a value of an integer collator attribute. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Attribute to get value for. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Attribute value, or <type>boolean</type> &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_get_attribute</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_CA' ); $val = collator_get_attribute( $coll, Collator::NUMERIC_COLLATION ); if( $val === false ) { // Handle error. } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname> constants</link></member> <member><function>collator_set_attribute</function></member> <member><function>collator_get_strength</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/get-error-code.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/get-error-code.xml +++ phpdoc/en/reference/intl/collator/get-error-code.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.geterrorcode" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::getErrorCode</refname> <refname>collator_get_error_code</refname> <refpurpose>Get collator's last error code</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>integer</type> <methodname>Collator::getErrorCode</methodname> <void /> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>collator_get_error_code</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> </methodsynopsis> <para> <!-- description goes here --> </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Error code returned by the last Collator <acronym>API</acronym> function call. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_get_error_code</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US' ); if( collator_get_attribute( $coll, Collator::FRENCH_COLLATION ) === false ) handle_error( collator_get_error_code() ); ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>collator_get_error_message</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/get-error-message.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/get-error-message.xml +++ phpdoc/en/reference/intl/collator/get-error-message.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.geterrormessage" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::getErrorMessage</refname> <refname>collator_get_error_message</refname> <refpurpose>Get text for collator's last error code</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>string</type> <methodname>Collator::getErrorMessage</methodname> <void /> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>collator_get_error_message</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> </methodsynopsis> <para> Retrieves the message for the last error. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Description of an error occurred in the last Collator <acronym>API</acronym> function call. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_get_error_message</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'lt' ); if( collator_compare( $coll, 'y', 'k' ) === false ) { echo collator_get_error_message( $coll ); } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>collator_get_error_code</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/get-locale.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/get-locale.xml +++ phpdoc/en/reference/intl/collator/get-locale.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.getlocale" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::getLocale</refname> <refname>collator_get_locale</refname> <refpurpose>Get the locale name of the collator</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Collator</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getLocale</methodname> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>collator_get_locale</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>integer</type><parameter>type</parameter></methodparam> </methodsynopsis> <para> Get collector locale name. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>type</parameter></term> <listitem> <para> You can choose between valid and actual locale ( <constant>Locale::VALID_LOCALE</constant> and <constant>Locale::ACTUAL_LOCALE</constant>, respectively). The default is the actual locale. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Real locale name from which the collation data comes. If the collator was instantiated from rules or an error occurred, returns <type>boolean</type> &false;. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_get_locale</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US_California' ); $res_val = collator_get_locale( $coll, Locale::VALID_LOCALE ); $res_act = collator_get_locale( $coll, Locale::ACTUAL_LOCALE ); printf( "Valid locale name: %s\nActual locale name: %s\n", $res_req, $res_val, $res_act ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ Requested locale name: en_US_California Valid locale name: en_US Actual locale name: en ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>collator_create</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/get-strength.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/get-strength.xml +++ phpdoc/en/reference/intl/collator/get-strength.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.getstrength" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::getStrength</refname> <refname>collator_get_strength</refname> <refpurpose>Get current collation strength</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>integer</type> <methodname>Collator::getStrength</methodname> <void /> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>collator_get_strength</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> </methodsynopsis> <para> <!-- description goes here --> </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns current collation strength, or <type>boolean</type> &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_get_strength</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US' ); $strength = collator_get_strength( $coll ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ // TODO ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname> constants</link></member> <member><function>collator_set_strength</function></member> <member><function>collator_get_attribute</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/set-attribute.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/set-attribute.xml +++ phpdoc/en/reference/intl/collator/set-attribute.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.setattribute" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::setAttribute</refname> <refname>collator_set_attribute</refname> <refpurpose>Set collation attribute</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>bool</type> <methodname>Collator::setAttribute</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>integer</type><parameter>val</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>collator_set_attribute</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>integer</type><parameter>val</parameter></methodparam> </methodsynopsis> <para> <!-- description goes here --> </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> <type>object</type>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para>Attribute.</para> </listitem> </varlistentry> <varlistentry> <term><parameter>val</parameter></term> <listitem> <para> Attribute value. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_set_attribute</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_CA' ); $val = collator_get_attribute( $coll, Collator::NUMERIC_COLLATION ); if ($val === false) { // Handle error. } elseif ($val === Collator::ON) { // Do something useful. } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname> constants</link></member> <member><function>collator_get_attribute</function></member> <member><function>collator_set_strength</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/set-strength.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/set-strength.xml +++ phpdoc/en/reference/intl/collator/set-strength.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.setstrength" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>Collator::setStrength</refname> <refname>collator_set_strength</refname> <refpurpose>Set collation strength</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>bool</type> <methodname>Collator::setStrength</methodname> <methodparam><type>integer</type><parameter>strength</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>collator_set_strength</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>integer</type><parameter>strength</parameter></methodparam> </methodsynopsis> <para> The <link xlink:href="&url.icu.home;">ICU</link> Collation Service supports many levels of comparison (named "Levels", but also known as "Strengths"). Having these categories enables ICU to sort strings precisely according to local conventions. However, by allowing the levels to be selectively employed, searching for a string in text can be performed with various matching conditions. </para> <para> <orderedlist> <listitem> <para> <emphasis> Primary Level</emphasis>: Typically, this is used to denote differences between base characters (for example, "a" < "b"). It is the strongest difference. For example, dictionaries are divided into different sections by base character. This is also called the level1 strength. </para> </listitem> <listitem> <para> <emphasis> Secondary Level</emphasis>: Accents in the characters are considered secondary differences (for example, "as" < "à s" < "at"). Other differences between letters can also be considered secondary differences, depending on the language. A secondary difference is ignored when there is a primary difference anywhere in the strings. This is also called the level2 strength. <note> <para> Note: In some languages (such as Danish), certain accented letters are considered to be separate base characters. In most languages, however, an accented letter only has a secondary difference from the unaccented version of that letter. </para> </note> </para> </listitem> <listitem> <para> <emphasis> Tertiary Level</emphasis>: Upper and lower case differences in characters are distinguished at the tertiary level (for example, "ao" < "Ao" < "aò"). In addition, a variant of a letter differs from the base form on the tertiary level (such as "A" and " "). Another example is the difference between large and small Kana. A tertiary difference is ignored when there is a primary or secondary difference anywhere in the strings. This is also called the level3 strength. </para> </listitem> <listitem> <para> <emphasis> Quaternary Level</emphasis>: When punctuation is ignored (see Ignoring Punctuations ) at level 13, an additional level can be used to distinguish words with and without punctuation (for example, "ab" < "a-b" < "aB"). This difference is ignored when there is a primary, secondary or tertiary difference. This is also known as the level4 strength. The quaternary level should only be used if ignoring punctuation is required or when processing Japanese text (see Hiragana processing). </para> </listitem> <listitem> <para> <emphasis> Identical Level</emphasis>: When all other levels are equal, the identical level is used as a tiebreaker. The Unicode code point values of the NFD form of each string are compared at this level, just in case there is no difference at levels 14. For example, Hebrew cantillation marks are only distinguished at this level. This level should be used sparingly, as only code point values differences between two strings is an extremely rare occurrence. Using this level substantially decreases the performance for both incremental comparison and sort key generation (as well as increasing the sort key length). It is also known as level 5 strength. </para> </listitem> </orderedlist> </para> <para> For example, people may choose to ignore accents or ignore accents and case when searching for text. Almost all characters are distinguished by the first three levels, and in most locales the default value is thus Tertiary. However, if Alternate is set to be Shifted, then the Quaternary strength can be used to break ties among whitespace, punctuation, and symbols that would otherwise be ignored. If very fine distinctions among characters are required, then the Identical strength can be used (for example, Identical Strength distinguishes between the Mathematical Bold Small A and the Mathematical Italic Small A.). However, using levels higher than Tertiary the Identical strength result in significantly longer sort keys, and slower string comparison performance for equal strings. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>strength</parameter></term> <listitem> <para>Strength to set.</para> <para> Possible values are: <itemizedlist> <listitem> <para> <constant>Collator::PRIMARY</constant> </para> </listitem> <listitem> <para> <constant>Collator::SECONDARY</constant> </para> </listitem> <listitem> <para> <constant>Collator::TERTIARY</constant> </para> </listitem> <listitem> <para> <constant>Collator::QUATERNARY</constant> </para> </listitem> <listitem> <para> <constant>Collator::IDENTICAL</constant> </para> </listitem> <listitem> <para> <constant>Collator::DEFAULT</constant> </para> </listitem> </itemizedlist> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_set_strength</function> example</title> <programlisting role="php"> <![CDATA[ <?php $arr = array( 'aò', 'Ao', 'ao' ); $coll = collator_create( 'en_US' ); // Sort array using default strength. collator_sort( $coll, $arr ); var_export( $arr ); // Sort array using primary strength. collator_set_strength( $coll, Collator::PRIMARY ); collator_sort( $coll, $arr ); var_export( $arr ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ array ( 0 => 'ao', 1 => 'Ao', 2 => 'aò', ) array ( 0 => 'aò', 1 => 'Ao', 2 => 'ao', ) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname> constants</link></member> <member><function>collator_get_strength</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/sort-with-sort-keys.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/sort-with-sort-keys.xml +++ phpdoc/en/reference/intl/collator/sort-with-sort-keys.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.sortwithsortkeys" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::sortWithSortKeys</refname> <refname>collator_sort_with_sort_keys</refname> <refpurpose>Sort array using specified collator and sort keys</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>bool</type> <methodname>Collator::sortWithSortKeys</methodname> <methodparam><type>array</type><parameter>arr</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>collator_sort_with_sort_keys</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>array</type><parameter>arr</parameter></methodparam> </methodsynopsis> <para> Similar to <function>collator_sort</function> but uses ICU sorting keys produced by ucol_getSortKey() to gain more speed on large arrays. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>arr</parameter></term> <listitem> <para>Array of strings to sort</para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_sort_with_sort_keys</function> example</title> <programlisting role="php"> <![CDATA[ <?php $arr = array( 'Köpfe', 'Kypper', 'Kopfe' ); $coll = collator_create( 'sv' ); collator_sort_with_sort_keys( $coll, $arr ); var_export( $arr ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ array ( 0 => 'Kopfe', 1 => 'Kypper', 2 => 'Köpfe', ) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname> constants</link></member> <member><function>collator_sort</function></member> <member><function>collator_asort</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/sort.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/sort.xml +++ phpdoc/en/reference/intl/collator/sort.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.sort" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::sort</refname> <refname>collator_sort</refname> <refpurpose>Sort array using specified collator</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>bool</type> <methodname>Collator::sort</methodname> <methodparam><type>array</type><parameter>arr</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>sort_flag</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>collator_sort</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>array</type><parameter>arr</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>sort_flag</parameter></methodparam> </methodsynopsis> <para>This function sorts an array according to current locale rules.</para> <para> Equivalent to standard PHP <function>sort</function> . </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>arr</parameter></term> <listitem> <para> Array of strings to sort. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>sort_flag</parameter></term> <listitem> <para> Optional sorting type, one of the following: </para> <para> <itemizedlist> <listitem> <para> <constant>Collator::SORT_REGULAR</constant> - compare items normally (don't change types) </para> </listitem> <listitem> <para> <constant>Collator::SORT_NUMERIC</constant> - compare items numerically </para> </listitem> <listitem> <para> <constant>Collator::SORT_STRING</constant> - compare items as strings </para> </listitem> </itemizedlist> Default sorting type is <constant>Collator::SORT_REGULAR</constant>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_sort</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US' ); $arr = array( 'at', 'à s', 'as' ); var_export( $arr ); collator_sort( $coll, $arr ); var_export( $arr ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ array ( 0 => 'at', 1 => 'à s', 2 => 'as', )array ( 0 => 'as', 1 => 'à s', 2 => 'at', ) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname> constants</link></member> <member><function>collator_asort</function></member> <member><function>collator_sort_with_sort_keys</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/compose-locale.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/compose-locale.xml +++ phpdoc/en/reference/intl/locale/compose-locale.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="locale.composelocale" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>Locale::composeLocale</refname> <refname>locale_compose_locale</refname> <refpurpose>Returns a correctly ordered and delimited locale ID</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>composeLocale</methodname> <methodparam><type>array</type><parameter>subtags</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_compose_locale</methodname> <methodparam><type>array</type><parameter>subtags</parameter></methodparam> </methodsynopsis> <para> Returns a correctly ordered and delimited locale ID the keys identify the particular locale ID subtags, and the values are the associated subtag values. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>subtags</parameter></term> <listitem> <para> an array containing a list of key-value pairs, where the keys identify the particular locale ID subtags, and the values are the associated subtag values. <note> <para> The 'variant' and 'private' subtags can take maximum 15 values whereas 'extlang' can take maximum 3 values.e.g. Variants are allowed with the suffix ranging from 0-14 Hence the keys for the input array can be variant0, variant1, ...,variant14 .In the returned locale id, the subtag is ordered by suffix resulting in variant0 followed by variant1 followed by variant2 and so on. </para> </note> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The corresponding locale identifier. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_compose_locale</function> example</title> <programlisting role="php"> <![CDATA[ <?php $arr = array( 'language'=>'en' , 'script' =>'Hans' , 'region' =>'CN', 'variant2'=>'rozaj' , 'variant1'=>'nedis' , 'private1'=>'prv1' , 'private2'=>'prv2' ); echo locale_compose( $arr ); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $arr = array( 'language'=>'en' , 'script' =>'Hans' , 'region' =>'CN', 'variant2'=>'rozaj' , 'variant1'=>'nedis' , 'private1'=>'prv1' , 'private2'=>'prv2' ); echo Locale::composeLocale( $arr ); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Locale: en_Hans_CN_nedis_rozaj_x_prv1_prv2 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_parse</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/filter-matches.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/filter-matches.xml +++ phpdoc/en/reference/intl/locale/filter-matches.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.filtermatches"> <refnamediv> <refname>Locale::filterMatches</refname> <refname>locale_filter_matches</refname> <refpurpose>Checks if a $langtag filter matches with $locale according to</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>boolean</type> <methodname>filterMatches</methodname> <methodparam><type>string</type><parameter>langtag</parameter></methodparam> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>boolean</type> <methodname>locale_filter_matches</methodname> <methodparam><type>string</type><parameter>langtag</parameter></methodparam> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Checks if a $langtag filter matches with $locale according to RFC 4647's basic filtering algorithm </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>langtag</parameter></term> <listitem> <para> The language tag to check </para> </listitem> </varlistentry> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The language range to check against </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &true; if $locale matches $langtag &false; otherwise. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_filter_matches</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo (locale_filter_matches('de-DEVA','de-DE', false)) ? "Matches" : "Does not match"; echo '; '; echo (locale_filter_matches('de-DE_1996','de-DE', false)) ? "Matches" : "Does not match"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo (Locale::filter_matches('de-DEVA','de-DE', false)) ? "Matches" : "Does not match"; echo '; '; echo (Locale::filter_matches('de-DE-1996','de-DE', false)) ? "Matches" : "Does not match"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Does not match; Matches ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_lookup</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-all-variants.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-all-variants.xml +++ phpdoc/en/reference/intl/locale/get-all-variants.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getallvariants"> <refnamediv> <refname>Locale::getAllVariants</refname> <refname>locale_get_all_variants</refname> <refpurpose>Gets the variants for the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>array</type> <methodname>getAllVariants</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>array</type> <methodname>locale_get_all_variants</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Gets the variants for the input locale </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to extract the variants from </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The <type>array</type> containing the list of all variants subtag for the locale or &null; if not present </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_all_variants</function> example</title> <programlisting role="php"> <![CDATA[ <?php $arr = locale_get_all_variants('sl_IT_NEDIS_ROJAZ_1901'); var_export( $arr ); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $arr = Locale::getAllVariants('sl_IT_NEDIS_ROJAZ_1901'); var_export( $arr ); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ array ( 0 => 'NEDIS', 1 => 'ROJAZ', 2 => '1901', ) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_primary_language</function></member> <member><function>locale_get_script</function></member> <member><function>locale_get_region</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-default.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-default.xml +++ phpdoc/en/reference/intl/locale/get-default.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getdefault"> <refnamediv> <refname>Locale::getDefault</refname> <refname>locale_get_default</refname> <refpurpose>Gets the default locale value from the INTL global 'default_locale'</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getDefault</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_default</methodname> <void /> </methodsynopsis> <para> Gets the default locale value. At the PHP initialization this value is set to 'intl.default_locale' value from &php.ini; if that value exists or from ICU's function uloc_getDefault(). </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The current runtime locale </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_default</function> example</title> <programlisting role="php"> <![CDATA[ <?php ini_set('intl.default_locale', 'de-DE'); echo locale_get_default(); echo '; '; locale_set_default('fr'); echo locale_get_default(); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php ini_set('intl.default_locale', 'de-DE'); echo Locale::getDefault(); echo '; '; Locale::setDefault('fr'); echo Locale::getDefault(); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ de-DE; fr ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_set_default</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-display-language.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-display-language.xml +++ phpdoc/en/reference/intl/locale/get-display-language.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getdisplaylanguage"> <refnamediv> <refname>Locale::getDisplayLanguage</refname> <refname>locale_get_display_language</refname> <refpurpose>Returns an appropriately localized display name for language of the inputlocale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getDisplayLanguage</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_display_language</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> <para> Returns an appropriately localized display name for language of the input locale. If is &null; then the default locale is used. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to return a display language for </para> </listitem> </varlistentry> <varlistentry> <term><parameter>in_locale</parameter></term> <listitem> <para> Optional format locale to use to display the language name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> display name of the language for the $locale in the format appropriate for $in_locale. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_display_language</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_display_language('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo locale_get_display_language('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo locale_get_display_language('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Slovenian; slov\xc3\xa8ne; Slowenisch ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_display_name</function></member> <member><function>locale_get_display_script</function></member> <member><function>locale_get_display_region</function></member> <member><function>locale_get_display_variant</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-display-name.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-display-name.xml +++ phpdoc/en/reference/intl/locale/get-display-name.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getdisplayname"> <refnamediv> <refname>Locale::getDisplayName</refname> <refname>locale_get_display_name</refname> <refpurpose>Returns an appropriately localized display name for the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getDisplayName</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_display_name</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> <para> Returns an appropriately localized display name for the input locale. If is &null; then the default locale is used. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to return a display name for. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>in_locale</parameter></term> <listitem> <para>optional format locale</para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Display name of the locale in the format appropriate for $in_locale. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_display_name</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_display_name('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo locale_get_display_name('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo locale_get_display_name('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getDisplayName('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo Locale::getDisplayName('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo Locale::getDisplayName('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Slovenian (Latin, Italy, Natisone dialect); slov\xc3\xa8ne (latin, Italie, dialecte de Natisone; Slowenisch (Lateinisch, Italien, NEDIS) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_display_language</function></member> <member><function>locale_get_display_script</function></member> <member><function>locale_get_display_region</function></member> <member><function>locale_get_display_variant</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-display-region.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-display-region.xml +++ phpdoc/en/reference/intl/locale/get-display-region.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getdisplayregion"> <refnamediv> <refname>Locale::getDisplayRegion</refname> <refname>locale_get_display_region</refname> <refpurpose>Returns an appropriately localized display name for region of the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getDisplayRegion</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_display_region</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> <para> Returns an appropriately localized display name for region of the input locale. If is &null; then the default locale is used. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to return a display region for. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>in_locale</parameter></term> <listitem> <para> Optional format locale to use to display the region name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> display name of the region for the $locale in the format appropriate for $in_locale. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_display_region</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_display_region('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo locale_get_display_region('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo locale_get_display_region('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getDisplayRegion('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo Locale::getDisplayRegion('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo Locale::getDisplayRegion('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Italy; Italie; Italien ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_display_name</function></member> <member><function>locale_get_display_language</function></member> <member><function>locale_get_display_script</function></member> <member><function>locale_get_display_variant</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-display-script.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-display-script.xml +++ phpdoc/en/reference/intl/locale/get-display-script.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getdisplayscript"> <refnamediv> <refname>Locale::getDisplayScript</refname> <refname>locale_get_display_script</refname> <refpurpose>Returns an appropriately localized display name for script of the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getDisplayScript</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_display_script</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> <para> Returns an appropriately localized display name for script of the input locale. If is &null; then the default locale is used. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to return a display script for </para> </listitem> </varlistentry> <varlistentry> <term><parameter>in_locale</parameter></term> <listitem> <para> Optional format locale to use to display the script name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Display name of the script for the $locale in the format appropriate for $in_locale. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_display_script</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_display_script('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo locale_get_display_script('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo locale_get_display_script('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getDisplayScript('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo Locale::getDisplayScript('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo Locale::getDisplayScript('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Latin; latin; Lateinisch ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_display_name</function></member> <member><function>locale_get_display_language</function></member> <member><function>locale_get_display_region</function></member> <member><function>locale_get_display_variant</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-display-variant.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-display-variant.xml +++ phpdoc/en/reference/intl/locale/get-display-variant.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getdisplayvariant"> <refnamediv> <refname>Locale::getDisplayVariant</refname> <refname>locale_get_display_variant</refname> <refpurpose>Returns an appropriately localized display name for variants of the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getDisplayVariant</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_display_variant</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> <para> Returns an appropriately localized display name for variants of the input locale. If is &null; then the default locale is used. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to return a display variant for </para> </listitem> </varlistentry> <varlistentry> <term><parameter>in_locale</parameter></term> <listitem> <para> Optional format locale to use to display the variant name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Display name of the variant for the $locale in the format appropriate for $in_locale. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_display_variant</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_display_variant('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo locale_get_display_variant('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo locale_get_display_variant('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getDisplayVariant('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo Locale::getDisplayVariant('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo Locale::getDisplayVariant('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Natisone dialect; dialecte de Natisone; NEDIS ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_display_name</function></member> <member><function>locale_get_display_language</function></member> <member><function>locale_get_display_script</function></member> <member><function>locale_get_display_region</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-keywords.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-keywords.xml +++ phpdoc/en/reference/intl/locale/get-keywords.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getkeywords"> <refnamediv> <refname>Locale::getKeywords</refname> <refname>locale_get_keywords</refname> <refpurpose>Gets the keywords for the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>array</type> <methodname>getKeywords</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>array</type> <methodname>locale_get_keywords</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Gets the keywords for the input locale. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to extract the keywords from </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Associative <type>array</type> containing the keyword-value pairs for this locale </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_keywords</function> example</title> <programlisting role="php"> <![CDATA[ <?php $keywords_arr = locale_get_keywords( 'de_DE@currency=EUR;collation=PHONEBOOK' ); if ($keywords_arr) { foreach ($keywords_arr as $key => $value) { echo "$key = $value\n"; } } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $keywords_arr = Locale::getKeywords( 'de_DE@currency=EUR;collation=PHONEBOOK' ); if ($keywords_arr) { foreach( $keywords_arr as $key => $value){ echo "$key = $value\n"; } } ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ collation = PHONEBOOK currency = EUR ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_all_variants</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-primary-language.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-primary-language.xml +++ phpdoc/en/reference/intl/locale/get-primary-language.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getprimarylanguage"> <refnamediv> <refname>Locale::getPrimaryLanguage</refname> <refname>locale_get_primary_language</refname> <refpurpose>Gets the primary language for the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getPrimaryLanguage</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_primary_language</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Gets the primary language for the input locale </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to extract the primary language code from </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The language code associated with the language or &null; in case of error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_primary_language</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_primary_language('zh-Hant'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getPrimaryLanguage('zh-Hant'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ zh ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_script</function></member> <member><function>locale_get_region</function></member> <member><function>locale_get_all_variants</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-region.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-region.xml +++ phpdoc/en/reference/intl/locale/get-region.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getregion"> <refnamediv> <refname>Locale::getRegion</refname> <refname>locale_get_region</refname> <refpurpose>Gets the region for the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getRegion</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_region</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Gets the region for the input locale. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to extract the region code from </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The region subtag for the locale or &null; if not present </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_region</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_region('de-CH-1901'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getRegion('de-CH-1901'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ CH ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_primary_language</function></member> <member><function>locale_get_script</function></member> <member><function>locale_get_all_variants</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-script.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-script.xml +++ phpdoc/en/reference/intl/locale/get-script.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getscript"> <refnamediv> <refname>Locale::getScript</refname> <refname>locale_get_script</refname> <refpurpose>Gets the script for the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getScript</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_script</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Gets the script for the input locale. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to extract the script code from </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The script subtag for the locale or &null; if not present </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_script</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_script('sr-Cyrl'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getScript('sr-Cyrl'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Cyrl ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_primary_language</function></member> <member><function>locale_get_region</function></member> <member><function>locale_get_all_variants</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/lookup.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/lookup.xml +++ phpdoc/en/reference/intl/locale/lookup.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.lookup"> <refnamediv> <refname>Locale::lookup</refname> <refname>locale_lookup</refname> <refpurpose>Searches the language tag list for the best match to the language</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>lookup</methodname> <methodparam><type>array</type><parameter>langtag</parameter></methodparam> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>default</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_lookup</methodname> <methodparam><type>array</type><parameter>langtag</parameter></methodparam> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>default</parameter></methodparam> </methodsynopsis> <para> Searches the items in <parameter>langtag</parameter> for the best match to the language range specified in <parameter>locale</parameter> according to RFC 4647's lookup algorithm. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>langtag</parameter></term> <listitem> <para> An <type>array</type> containing a list of language tags to compare to <parameter>locale</parameter>. Maximum 100 items allowed. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to use as the language range when matching. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>default</parameter></term> <listitem> <para> The locale to use if no match is found. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The closest matching language tag or default value. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_lookup</function> example</title> <programlisting role="php"> <![CDATA[ <?php $arr = array( 'de-DEVA', 'de-DE-1996', 'de', 'de-De' ); echo locale_lookup($arr, 'de-DE-1996-x-prv1-prv2', 'en_US'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $arr = array( 'de-DEVA', 'de-DE-1996', 'de', 'de-De' ); echo Locale::lookup($arr, 'de-DE-1996-x-prv1-prv2', 'en_US'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ de_de_1996 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_filter_matches</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/parse-locale.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/parse-locale.xml +++ phpdoc/en/reference/intl/locale/parse-locale.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.parselocale"> <refnamediv> <refname>Locale::parseLocale</refname> <refname>locale_parse_locale</refname> <refpurpose>Returns a key-value array of locale ID subtag elements.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>array</type> <methodname>parseLocale</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>array</type> <methodname>locale_parse_locale</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Returns a key-value array of locale ID subtag elements. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to extract the subtag array from. Note: The 'variant' and 'private' subtags can take maximum 15 values whereas 'extlang' can take maximum 3 values. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an array containing a list of key-value pairs, where the keys identify the particular locale ID subtags, and the values are the associated subtag values. The array will be ordered as the locale id subtags e.g. in the locale id if variants are '-varX-varY-varZ' then the returned array will have variant0=>varX , variant1=>varY , variant2=>varZ </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_parse_locale</function> example</title> <programlisting role="php"> <![CDATA[ <?php $arr = locale_parse('sl-Latn-IT-nedis'); if ($arr) { foreach ($arr as $key => $value) { echo "$key : $value , "; } } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $arr = Locale::parseLocale('sl-Latn-IT-nedis'); if ($arr) { foreach ($arr as $key => $value) { echo "$key : $value , "; } } ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ language : sl , script : Latn , region : IT , variant0 : NEDIS , ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>compose_locale</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/set-default.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/set-default.xml +++ phpdoc/en/reference/intl/locale/set-default.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.setdefault"> <refnamediv> <refname>Locale::setDefault</refname> <refname>locale_set_default</refname> <refpurpose>sets the default runtime locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>boolean</type> <methodname>setDefault</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>boolean</type> <methodname>locale_set_default</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Sets the default runtime locale to $locale. This changes the value of INTL global 'default_locale' locale identifier. UAX #35 extensions are accepted. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> Is a BCP 47 compliant language tag containing the </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_set_default</function> example</title> <programlisting role="php"> <![CDATA[ <?php locale_set_default('de-DE'); echo locale_get_default(); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php Locale::setDefault('de-DE'); echo Locale::getDefault(); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ de-DE ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_default</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/create.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/create.xml +++ phpdoc/en/reference/intl/messageformatter/create.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.create"> <refnamediv> <refname>MessageFormatter::create</refname> <refname>MessageFormatter::__construct</refname> <refname>msgfmt_create</refname> <refpurpose>Constructs a new Message Formatter</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style (method) </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>MessageFormatter</type> <methodname>create</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Object oriented style (constructor): </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <constructorsynopsis> <methodname>__construct</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </constructorsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>MessageFormatter</type> <methodname>msgfmt_create</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> <para> Constructs a new Message Formatter </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to use when formatting arguments </para> </listitem> </varlistentry> <varlistentry> <term><parameter>pattern</parameter></term> <listitem> <para> The pattern string to stick arguments into </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The formatter <type>object</type> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_create</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); echo msgfmt_format($fmt, array(4560, 123, 4560/123)); $fmt = msgfmt_create("de", "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum"); echo msgfmt_format($fmt, array(4560, 123, 4560/123)); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); echo $fmt->format(array(4560, 123, 4560/123)); $fmt = new MessageFormatter("de", "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum"); echo $fmt->format(array(4560, 123, 4560/123)); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 4,560 monkeys on 123 trees make 37.073 monkeys per tree 4.560 Affen über 123 Bäume um 37,073 Affen pro Baum ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_format</function></member> <member><function>msgfmt_parse</function></member> <member><function>msgfmt_get_error_code</function></member> <member><function>msgfmt_get_error_message</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/format-message.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/format-message.xml +++ phpdoc/en/reference/intl/messageformatter/format-message.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.formatmessage"> <refnamediv> <refname>MessageFormatter::formatMessage</refname> <refname>msgfmt_format_message</refname> <refpurpose>Quick format message</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>formatMessage</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> <methodparam><type>array</type><parameter>args</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>msgfmt_format_message</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> <methodparam><type>array</type><parameter>args</parameter></methodparam> </methodsynopsis> <para> Quick formatting function that formats the string without having to explicitly create the formatter object. Use this function when the format operation is done only once and does not need and parameters or state to be kept. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to use for formatting locale-dependent parts </para> </listitem> </varlistentry> <varlistentry> <term><parameter>pattern</parameter></term> <listitem> <para> The pattern <type>string</type> to insert things into </para> </listitem> </varlistentry> <varlistentry> <term><parameter>args</parameter></term> <listitem> <para> The <type>array</type> of values to insert into the format <type>string</type> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The formatted pattern string or &false; if an error occurred </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_format_message</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo msgfmt_format_message("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree", array(4560, 123, 4560/123)); echo msgfmt_format_message("de", "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum", array(4560, 123, 4560/123)); ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo msgfmt_format_message("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree", array(4560, 123, 4560/123)); echo msgfmt_format_message("de", "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum", array(4560, 123, 4560/123)); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 4,560 monkeys on 123 trees make 37.073 monkeys per tree 4.560 Affen über 123 Bäume um 37,073 Affen pro Baum ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</function></member> <member><function>msgfmt_parse</function></member> <member><function>msgfmt_get_error_code</function></member> <member><function>msgfmt_get_error_message</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/format.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/format.xml +++ phpdoc/en/reference/intl/messageformatter/format.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.format"> <refnamediv> <refname>MessageFormatter::format</refname> <refname>msgfmt_format</refname> <refpurpose>Format the message</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>format</methodname> <methodparam><type>array</type><parameter>args</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>msgfmt_format</methodname> <methodparam><type>MessageFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>array</type><parameter>args</parameter></methodparam> </methodsynopsis> <para> Format the message by substituting the data into the format string according to the locale rules </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> The message formatter </para> </listitem> </varlistentry> <varlistentry> <term><parameter>args</parameter></term> <listitem> <para> Arguments to insert into the format string </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The formatted string, or &false; if an error occurred </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_format</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); echo msgfmt_format($fmt, array(4560, 123, 4560/123)); $fmt = msgfmt_create("de", "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum"); echo msgfmt_format($fmt, array(4560, 123, 4560/123)); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); echo $fmt->format(array(4560, 123, 4560/123)); $fmt = new MessageFormatter("de", "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum"); echo $fmt->format(array(4560, 123, 4560/123)); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 4,560 monkeys on 123 trees make 37.073 monkeys per tree 4.560 Affen über 123 Bäume um 37,073 Affen pro Baum ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</function></member> <member><function>msgfmt_parse</function></member> <member><function>msgfmt_format_message</function></member> <member><function>msgfmt_get_error_code</function></member> <member><function>msgfmt_get_error_message</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/get-error-code.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/get-error-code.xml +++ phpdoc/en/reference/intl/messageformatter/get-error-code.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.geterrorcode"> <refnamediv> <refname>MessageFormatter::getErrorCode</refname> <refname>msgfmt_get_error_code</refname> <refpurpose>Get the error code from last operation</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>integer</type> <methodname>getErrorCode</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>msgfmt_get_error_code</methodname> <methodparam><type>MessageFormatter</type><parameter>fmt</parameter></methodparam> </methodsynopsis> <para> Get the error code from last operation. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> The message formatter </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The error code, one of UErrorCode values. Initial value is U_ZERO_ERROR. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_get_error_code</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create("en_US", "{0, number} monkeys on {1, number} trees"); $str = msgfmt_format($fmt, array()); if(!$str) { echo "ERROR: ".msgfmt_get_error_message($fmt) . " (" . msgfmt_get_error_code($fmt) . ")\n"; } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter("en_US", "{0, number} monkeys on {1, number} trees"); $str = $fmt->format(array()); if(!$str) { echo "ERROR: ".$fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n"; } ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ ERROR: msgfmt_format: not enough parameters: U_ILLEGAL_ARGUMENT_ERROR (1) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_get_error_message</function></member> <member><function>intl_get_error_code</function></member> <member><function>intl_is_failure</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/get-error-message.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/get-error-message.xml +++ phpdoc/en/reference/intl/messageformatter/get-error-message.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.geterrormessage"> <refnamediv> <refname>MessageFormatter::getErrorMessage</refname> <refname>msgfmt_get_error_message</refname> <refpurpose>Get the error text from the last operation</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getErrorMessage</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>msgfmt_get_error_message</methodname> <methodparam><type>MessageFormatter</type><parameter>fmt</parameter></methodparam> </methodsynopsis> <para> Get the error text from the last operation. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> The message formatter </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Description of the last error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_get_error_message</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create("en_US", "{0, number} monkeys on {1, number} trees"); $str = msgfmt_format($fmt, array()); if(!$str) { echo "ERROR: ".msgfmt_get_error_message($fmt) . " (" . msgfmt_get_error_code($fmt) . ")\n"; } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter("en_US", "{0, number} monkeys on {1, number} trees"); $str = $fmt->format(array()); if(!$str) { echo "ERROR: ".$fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n"; } ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ ERROR: msgfmt_format: not enough parameters: U_ILLEGAL_ARGUMENT_ERROR (1) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_get_error_code</function></member> <member><function>intl_get_error_code</function></member> <member><function>intl_is_failure</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/get-locale.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/get-locale.xml +++ phpdoc/en/reference/intl/messageformatter/get-locale.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.getlocale"> <refnamediv> <refname>MessageFormatter::getLocale</refname> <refname>msgfmt_get_locale</refname> <refpurpose>Get the locale for which the formatter was created.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getLocale</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>msgfmt_get_locale</methodname> <methodparam><type>NumberFormatter</type><parameter>formatter</parameter></methodparam> </methodsynopsis> <para> Get the locale for which the formatter was created. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>formatter</parameter></term> <listitem> <para> The formatter resource </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The locale name </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_get_locale</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create('en_US', "Number {0,number}"); echo msgfmt_get_locale($fmt); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter('en_US', "Number {0,number}"); echo $fmt->getLocale(); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ en_US ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/get-pattern.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/get-pattern.xml +++ phpdoc/en/reference/intl/messageformatter/get-pattern.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.getpattern"> <refnamediv> <refname>MessageFormatter::getPattern</refname> <refname>msgfmt_get_pattern</refname> <refpurpose>Get the pattern used by the formatter</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getPattern</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>msgfmt_get_pattern</methodname> <methodparam><type>MessageFormatter</type><parameter>fmt</parameter></methodparam> </methodsynopsis> <para> Get the pattern used by the formatter </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> The message formatter </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The pattern <type>string</type> for this message formatter </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_get_pattern</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create( "en_US", "{0, number} monkeys on {1, number} trees" ); echo "Default pattern: '" . msgfmt_get_pattern( $fmt ) . "'\n"; echo "Formatting result: " . msgfmt_format( $fmt, array(123, 456) ) . "\n"; msgfmt_set_pattern( $fmt, "{0, number} trees hosting {1, number} monkeys" ); echo "New pattern: '" . msgfmt_get_pattern( $fmt ) . "'\n"; echo "Formatted number: " . msgfmt_format( $fmt, array(123, 456) ) . "\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter( "en_US", "{0, number} monkeys on {1, number} trees" ); echo "Default pattern: '" . $fmt->getPattern() . "'\n"; echo "Formatting result: " . $fmt->format(array(123, 456)) . "\n"; $fmt->setPattern("{0, number} trees hosting {1, number} monkeys" ); echo "New pattern: '" . $fmt->getPattern() . "'\n"; echo "Formatted number: " . $fmt->format(array(123, 456)) . "\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Default pattern: '{0,number} monkeys on {1,number} trees' Formatting result: 123 monkeys on 456 trees New pattern: '{0,number} trees hosting {1,number} monkeys' Formatted number: 123 trees hosting 456 monkeys ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</function></member> <member><function>msgfmt_set_pattern</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/parse-message.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/parse-message.xml +++ phpdoc/en/reference/intl/messageformatter/parse-message.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.parsemessage"> <refnamediv> <refname>MessageFormatter::parseMessage</refname> <refname>msgfmt_parse_message</refname> <refpurpose>Quick parse input string</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>array</type> <methodname>parseMessage</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>array</type> <methodname>msgfmt_parse_message</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> Parses input string without explicitly creating the formatter object. Use this function when the format operation is done only once and does not need and parameters or state to be kept. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to use for parsing locale-dependent parts </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> The <type>string</type> to parse for items </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> An <type>array</type> containing items extracted, or &false; on error </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_parse_message</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_parse_message('en_US', "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree", "4,560 monkeys on 123 trees make 37.073 monkeys per tree"); var_export($res); $fmt = msgfmt_parse_message('de', "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum", "4.560 Affen über 123 Bäume um 37,073 Affen pro Baum"); var_export($res); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = MessageFormatter::parseMessage('en_US', "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree", "4,560 monkeys on 123 trees make 37.073 monkeys per tree"); var_export($res); $fmt = MessageFormatter::parseMessage('de', "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum", "4.560 Affen über 123 Bäume um 37,073 Affen pro Baum"); var_export($res); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ array ( 0 => 4560, 1 => 123, 2 => 37.073, ) array ( 0 => 4560, 1 => 123, 2 => 37.073, ) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</function></member> <member><function>msgfmt_format_message</function></member> <member><function>msgfmt_parse</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/parse.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/parse.xml +++ phpdoc/en/reference/intl/messageformatter/parse.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.parse"> <refnamediv> <refname>MessageFormatter::parse</refname> <refname>msgfmt_parse</refname> <refpurpose>Parse input string according to pattern</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>array</type> <methodname>parse</methodname> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>array</type> <methodname>msgfmt_parse</methodname> <methodparam><type>MessageFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> Parses input <type>string</type> and return any extracted items as an <type>array</type>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> The message formatter </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> The <type>string</type> to parse </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> An <type>array</type> containing the items extracted, or &false; on error </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_parse</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create('en_US', "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); $res = msgfmt_parse($fmt, "4,560 monkeys on 123 trees make 37.073 monkeys per tree"); var_export($res); $fmt = msgfmt_create('de', "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum"); $res = msgfmt_parse($fmt, "4.560 Affen über 123 Bäume um 37,073 Affen pro Baum"); var_export($res); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter('en_US', "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); $res = $fmt->parse("4,560 monkeys on 123 trees make 37.073 monkeys per tree"); var_export($res); $fmt = new MessageFormatter('de', "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum"); $res = $fmt->parse("4.560 Affen über 123 Bäume um 37,073 Affen pro Baum"); var_export($res); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ array ( 0 => 4560, 1 => 123, 2 => 37.073, ) array ( 0 => 4560, 1 => 123, 2 => 37.073, ) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</function></member> <member><function>msgfmt_format</function></member> <member><function>msgfmt_parse_message</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/set-pattern.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/set-pattern.xml +++ phpdoc/en/reference/intl/messageformatter/set-pattern.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.setpattern"> <refnamediv> <refname>MessageFormatter::setPattern</refname> <refname>msgfmt_set_pattern</refname> <refpurpose>Set the pattern used by the formatter</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>boolean</type> <methodname>setPattern</methodname> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>boolean</type> <methodname>msgfmt_set_pattern</methodname> <methodparam><type>MessageFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> <para> Set the pattern used by the formatter </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> The message formatter </para> </listitem> </varlistentry> <varlistentry> <term><parameter>pattern</parameter></term> <listitem> <para> The pattern <type>string</type> to use in this message formatter </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_set_pattern</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create( "en_US", "{0, number} monkeys on {1, number} trees" ); echo "Default pattern: '" . msgfmt_get_pattern( $fmt ) . "'\n"; echo "Formatting result: " . msgfmt_format( $fmt, array(123, 456) ) . "\n"; msgfmt_set_pattern( $fmt, "{0, number} trees hosting {1, number} monkeys" ); echo "New pattern: '" . msgfmt_get_pattern( $fmt ) . "'\n"; echo "Formatted number: " . msgfmt_format( $fmt, array(123, 456) ) . "\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter( "en_US", "{0, number} monkeys on {1, number} trees" ); echo "Default pattern: '" . $fmt->getPattern() . "'\n"; echo "Formatting result: " . $fmt->format(array(123, 456)) . "\n"; $fmt->setPattern("{0, number} trees hosting {1, number} monkeys" ); echo "New pattern: '" . $fmt->getPattern() . "'\n"; echo "Formatted number: " . $fmt->format(array(123, 456)) . "\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Default pattern: '{0,number} monkeys on {1,number} trees' Formatting result: 123 monkeys on 456 trees New pattern: '{0,number} trees hosting {1,number} monkeys' Formatted number: 123 trees hosting 456 monkeys ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</function></member> <member><function>msgfmt_get_pattern</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/normalizer/is-normalized.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/normalizer/is-normalized.xml +++ phpdoc/en/reference/intl/normalizer/is-normalized.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="normalizer.isnormalized"> <refnamediv> <refname>Normalizer::isNormalized</refname> <refname>normalizer_is_normalized</refname> <refpurpose>Checks if the provided string is already in the specified normalization form.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Normalizer</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>boolean</type> <methodname>isNormalized</methodname> <methodparam><type>string</type><parameter>input</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>boolean</type> <methodname>normalizer_is_normalized</methodname> <methodparam><type>string</type><parameter>input</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> </methodsynopsis> <para> Checks if the provided string is already in the specified normalization form. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>input</parameter></term> <listitem> <para> The input string to normalize </para> </listitem> </varlistentry> <varlistentry> <term><parameter>form</parameter></term> <listitem> <para> One of the normalization forms </para> </listitem> </varlistentry> <varlistentry> <term><parameter>options</parameter></term> <listitem> <para> Normalization options </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &true; if normalized, &false; otherwise or if there an error </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>normalizer_is_normalized</function> example</title> <programlisting role="php"> <![CDATA[ <?php $char_A_ring = "\xC3\x85"; // 'LATIN CAPITAL LETTER A WITH RING ABOVE' (U+00C5) $char_combining_ring_above = "\xCC\x8A"; // 'COMBINING RING ABOVE' (U+030A) $char_orig = 'A' . $char_combining_ring_above; $char_norm = normalizer_normalize( 'A' . $char_combining_ring_above, Normalizer::FORM_C ); echo ( normalizer_is_normalized($char_orig, Normalizer::FORM_C) ) ? "normalized" : "not normalized"; echo '; '; echo ( normalizer_is_normalized($char_norm, Normalizer::FORM_C) ) ? "normalized" : "not normalized"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $char_A_ring = "\xC3\x85"; // 'LATIN CAPITAL LETTER A WITH RING ABOVE' (U+00C5) $char_combining_ring_above = "\xCC\x8A"; // 'COMBINING RING ABOVE' (U+030A) $char_orig = 'A' . $char_combining_ring_above; $char_norm = Normalizer::normalize( 'A' . $char_combining_ring_above, Normalizer::FORM_C ); echo ( Normalizer::isNormalized($char_orig, Normalizer::FORM_C) ) ? "normalized" : "not normalized"; echo '; '; echo ( Normalizer::isNormalized($char_norm, Normalizer::FORM_C) ) ? "normalized" : "not normalized"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ not normalized; normalized ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>normalizer_normalize</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/normalizer/normalize.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/normalizer/normalize.xml +++ phpdoc/en/reference/intl/normalizer/normalize.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="normalizer.normalize"> <refnamediv> <refname>Normalizer::normalize</refname> <refname>normalizer_normalize</refname> <refpurpose>Normalizes the input provided and returns the normalized string</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Normalizer</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>normalize</methodname> <methodparam><type>string</type><parameter>input</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>normalizer_normalize</methodname> <methodparam><type>string</type><parameter>input</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> </methodsynopsis> <para> Normalizes the input provided and returns the normalized <type>string</type> </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>input</parameter></term> <listitem> <para> The input string to normalize </para> </listitem> </varlistentry> <varlistentry> <term><parameter>form</parameter></term> <listitem> <para> One of the normalization forms </para> </listitem> </varlistentry> <varlistentry> <term><parameter>options</parameter></term> <listitem> <para> Normalization options </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The normalized string or &null; if an error occurred. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>normalizer_normalize</function> example</title> <programlisting role="php"> <![CDATA[ <?php $char_A_ring = "\xC3\x85"; // 'LATIN CAPITAL LETTER A WITH RING ABOVE' (U+00C5) $char_combining_ring_above = "\xCC\x8A"; // 'COMBINING RING ABOVE' (U+030A) $char_1 = normalizer_normalize( $char_A_ring, Normalizer::FORM_C ); $char_2 = normalizer_normalize( 'A' . $char_combining_ring_above, Normalizer::FORM_C ); echo urlencode($char_1); echo ' '; echo urlencode($char_2); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $char_A_ring = "\xC3\x85"; // 'LATIN CAPITAL LETTER A WITH RING ABOVE' (U+00C5) $char_combining_ring_above = "\xCC\x8A"; // 'COMBINING RING ABOVE' (U+030A) $char_1 = Normalizer::normalize( $char_A_ring, Normalizer::FORM_C ); $char_2 = Normalizer::normalize( 'A' . $char_combining_ring_above, Normalizer::FORM_C ); echo urlencode($char_1); echo ' '; echo urlencode($char_2); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ %C3%85 %C3%85 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>normalizer_is_normalized</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/create.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/create.xml +++ phpdoc/en/reference/intl/numberformatter/create.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.create" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::create</refname> <refname>numfmt_create</refname> <refname>NumberFormatter::__construct</refname> <refpurpose>Create a number formatter</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style (method) </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>NumberFormatter</type> <methodname>create</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>integer</type><parameter>style</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>NumberFormatter</type> <methodname>numfmt_create</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>integer</type><parameter>style</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> <para> Object oriented style (constructor): </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <constructorsynopsis> <methodname>__construct</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>integer</type><parameter>style</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>pattern</parameter></methodparam> </constructorsynopsis> </classsynopsis> <para> Creates a number formatter. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> Locale in which the number would be formatted (locale name, e.g. en_CA). </para> </listitem> </varlistentry> <varlistentry> <term><parameter>style</parameter></term> <listitem> <para> Style of the formatting, one of the <link linkend="intl.numberformatter-constants.UNumberFormatStyle"> format style</link> constants. If <constant>NumberFormatter::PATTERN_DECIMAL</constant> or <constant>NumberFormatter::PATTERN_RULEBASED</constant> is passed then the number format is opened using the given pattern, which must conform to the syntax described in <link xlink:href="&url.icu.decimalformat;">ICU DecimalFormat documentation</link> or <link xlink:href="&url.icu.ruleformat;">ICU RuleBasedNumberFormat documentation</link>, respectively. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>pattern</parameter></term> <listitem> <para> Pattern string in case chosen style requires pattern. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns <classname>NumberFormatter</classname> object or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_create</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo numfmt_format($fmt, 1234567.891234567890000)."\n"; $fmt = numfmt_create( 'it', NumberFormatter::SPELLOUT ); echo numfmt_format($fmt, 1142)."\n"; ?> ]]> </programlisting> </example> <example> <title><function>NumberFormatter</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo $fmt->format(1234567.891234567890000)."\n"; $fmt = new NumberFormatter( 'it', NumberFormatter::SPELLOUT ); echo $fmt->format(1142)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 1.234.567,891 millicentoquarantadue ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_format</function></member> <member><function>numfmt_parse</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/format-currency.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/format-currency.xml +++ phpdoc/en/reference/intl/numberformatter/format-currency.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.formatcurrency" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::formatCurrency</refname> <refname>numfmt_format_currency</refname> <refpurpose>Format a currency value</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>formatCurrency</methodname> <methodparam><type>double</type><parameter>value</parameter></methodparam> <methodparam><type>string</type><parameter>currency</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_format_currency</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>double</type><parameter>value</parameter></methodparam> <methodparam><type>string</type><parameter>currency</parameter></methodparam> </methodsynopsis> <para> Format the currency value according to the formatter rules. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> The numeric currency value. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>currency</parameter></term> <listitem> <para> The 3-letter ISO 4217 currency code indicating the currency to use. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> String representing the formatted currency value. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_format_currency</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::CURRENCY ); echo numfmt_format_currency($fmt, 1234567.891234567890000, "EUR")."\n"; echo numfmt_format_currency($fmt, 1234567.891234567890000, "RUR")."\n"; $fmt = numfmt_create( 'ru_RU', NumberFormatter::CURRENCY ); echo numfmt_format_currency($fmt, 1234567.891234567890000, "EUR")."\n"; echo numfmt_format_currency($fmt, 1234567.891234567890000, "RUR")."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::CURRENCY ); echo $fmt->formatCurrency(1234567.891234567890000, "EUR")."\n"; echo $fmt->formatCurrency(1234567.891234567890000, "RUR")."\n"; $fmt = new NumberFormatter( 'ru_RU', NumberFormatter::CURRENCY ); echo $fmt->formatCurrency(1234567.891234567890000, "EUR")."\n"; echo $fmt->formatCurrency(1234567.891234567890000, "RUR")."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 1.234.567,89 ⬠1.234.567,89 RUR 1 234 567,89⬠1 234 567,89Ñ. ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_format</function></member> <member><function>numfmt_parse_currency</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/format.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/format.xml +++ phpdoc/en/reference/intl/numberformatter/format.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.format" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::format</refname> <refname>numfmt_format</refname> <refpurpose>Format a number</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>format</methodname> <methodparam><type>integer|double</type><parameter>value</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_format</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer|double</type><parameter>value</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> </methodsynopsis> <para> Format a numeric value according to the formatter rules. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> The value to format. Can be <type>integer</type> or <type>double</type>, other values will be converted to a numeric value. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>type</parameter></term> <listitem> <para> The <link linkend="intl.numberformatter-constants.types"> formatting type</link> to use. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the string containing formatted value, or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_format</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); $data = numfmt_format($fmt, 1234567.891234567890000); if(intl_is_failure(numfmt_format($fmt))) { report_error("Formatter error"); } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); $fmt->format(1234567.891234567890000); if(intl_is_failure($fmt->getErrorCode()) { report_error("Formatter error"); } ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 1.234.567,891 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_format_currency</function></member> <member><function>numfmt_parse</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-attribute.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-attribute.xml +++ phpdoc/en/reference/intl/numberformatter/get-attribute.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.getattribute" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getAttribute</refname> <refname>numfmt_get_attribute</refname> <refpurpose>Get an attribute</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>integer</type> <methodname>getAttribute</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>numfmt_get_attribute</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> <para> Get a numeric attribute associated with the formatter. An example of a numeric attribute is the number of integer digits the formatter will produce. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Attribute specifier - one of the <link linkend="intl.numberformatter-constants.UNumberFormatAttribute"> numeric attribute</link> constants. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Return attribute value on success, or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_attribute</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Digits: ".numfmt_get_attribute($fmt, NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; numfmt_set_attribute($fmt, NumberFormatter::MAX_FRACTION_DIGITS, 2); echo "Digits: ".numfmt_get_attribute($fmt, NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Digits: ".$fmt->getAttribute(NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; $fmt->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, 2); echo "Digits: ".$fmt->getAttribute(NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Digits: 3 1.234.567,891 Digits: 2 1.234.567,89 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_get_text_attribute</function></member> <member><function>numfmt_set_attribute</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-error-code.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-error-code.xml +++ phpdoc/en/reference/intl/numberformatter/get-error-code.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.geterrorcode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getErrorCode</refname> <refname>numfmt_get_error_code</refname> <refpurpose>Get formatter's last error code.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>integer</type> <methodname>getErrorCode</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>numfmt_get_error_code</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> </methodsynopsis> <para> Get error code from the last function performed by the formatter. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns error code from last formatter call. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_error_code</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); $data = numfmt_format($fmt, 1234567.891234567890000); if(intl_is_failure(numfmt_get_error_code($fmt))) { report_error("Formatter error"); } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); $fmt->format(1234567.891234567890000); if(intl_is_failure($fmt->getErrorCode()) { report_error("Formatter error"); } ?> ]]> </programlisting> </example> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_message</function></member> <member><function>intl_get_error_code</function></member> <member><function>intl_is_failure</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-error-message.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-error-message.xml +++ phpdoc/en/reference/intl/numberformatter/get-error-message.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.geterrormessage" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getErrorMessage</refname> <refname>numfmt_get_error_message</refname> <refpurpose>Get formatter's last error message.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getErrorMessage</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_get_error_message</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> </methodsynopsis> <para> Get error message from the last function performed by the formatter. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns error message from last formatter call. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_error_message</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); $data = numfmt_format($fmt, 1234567.891234567890000); if(intl_is_failure(numfmt_get_error_code($fmt))) { report_error("Formatter error"); } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); $fmt->format(1234567.891234567890000); if(intl_is_failure($fmt->getErrorCode()) { report_error("Formatter error"); } ?> ]]> </programlisting> </example> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_message</function></member> <member><function>intl_get_error_code</function></member> <member><function>intl_is_failure</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-locale.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-locale.xml +++ phpdoc/en/reference/intl/numberformatter/get-locale.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.getlocale" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getLocale</refname> <refname>numfmt_get_locale</refname> <refpurpose>Get formatter locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getLocale</methodname> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_get_locale</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> </methodsynopsis> <para> Get formatter locale name. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>type</parameter></term> <listitem> <para> You can choose between valid and actual locale ( <constant>Locale::VALID_LOCALE</constant>, <constant>Locale::ACTUAL_LOCALE</constant>, respectively). The default is the actual locale. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The locale name used to create the formatter. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_locale</function> example</title> <programlisting role="php"> <![CDATA[ <?php $req = 'fr_FR_PARIS'; $fmt = numfmt_create( $req, NumberFormatter::DECIMAL); $res_val = numfmt_get_locale( $fmt, Locale::VALID_LOCALE ); $res_act = numfmt_get_locale( $fmt, Locale::ACTUAL_LOCALE ); printf( "Requested locale name: %s\nValid locale name: %s\nActual locale name: %s\n", $req, $res_val, $res_act ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ Requested locale name: fr_FR_PARIS Valid locale name: fr_FR Actual locale name: fr ]]> </screen> </example> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_create</function></member> <member><function>numfmt_get_error_code</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-pattern.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-pattern.xml +++ phpdoc/en/reference/intl/numberformatter/get-pattern.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.getpattern" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getPattern</refname> <refname>numfmt_get_pattern</refname> <refpurpose>Get formatter pattern</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getPattern</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_get_pattern</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> </methodsynopsis> <para> Extract pattern used by the formatter. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Pattern <type>string</type> that is used by the formatter, or &false; if an error happens. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_pattern</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Pattern: ".numfmt_get_pattern($fmt)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; numfmt_set_pattern($fmt, "#0.# kg"); echo "Pattern: ".numfmt_get_pattern($fmt)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Pattern: ".$fmt->getPattern()."\n"; echo $fmt->format(1234567.891234567890000)."\n"; $fmt->setPattern("#0.# kg"); echo "Pattern: ".$fmt->getPattern()."\n"; echo $fmt->format(1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Pattern: #,##0.### 1.234.567,891 Pattern: #0.# kg 1234567,9 kg ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_set_pattern</function></member> <member><function>numfmt_create</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-symbol.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-symbol.xml +++ phpdoc/en/reference/intl/numberformatter/get-symbol.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.getsymbol" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getSymbol</refname> <refname>numfmt_get_symbol</refname> <refpurpose>Get a symbol value</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getSymbol</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_get_symbol</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> <para> Get a symbol associated with the formatter. The formatter uses symbols to represent the special locale-dependent characters in a number, for example the percent sign. This API is not supported for rule-based formatters. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Symbol specifier, one of the <link linkend="intl.numberformatter-constants.UNumberFormatSymbol"> format symbol</link> constants. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The symbol string or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_symbol</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Sep: ".numfmt_get_symbol($fmt, NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; numfmt_set_symbol($fmt, NumberFormatter::GROUPING_SEPARATOR_SYMBOL, "*"); echo "Sep: ".numfmt_get_symbol($fmt, NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Sep: ".$fmt->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; $fmt->setSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL, "*"); echo "Sep: ".$fmt->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Sep: . 1.234.567,891 Sep: * 1*234*567,891 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_set_symbol</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-text-attribute.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-text-attribute.xml +++ phpdoc/en/reference/intl/numberformatter/get-text-attribute.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.gettextattribute" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getTextAttribute</refname> <refname>numfmt_get_text_attribute</refname> <refpurpose>Get a text attribute</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getTextAttribute</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_get_text_attribute</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> <para> Get a text attribute associated with the formatter. An example of a text attribute is the suffix for positive numbers. If the formatter does not understand the attributre, <constant>U_UNSUPPORTED_ERROR</constant> error is produced. Rule-based formatters only understand <constant>NumberFormatter::DEFAULT_RULESET</constant> and <constant>NumberFormatter::PUBLIC_RULESETS</constant>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Attribute specifier - one of the <link linkend="intl.numberformatter-constants.UNumberFormatTextAttribute"> text attribute</link> constants. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Return attribute value on success, or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_text_attribute</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Prefix: ".numfmt_get_text_attribute($fmt, NumberFormatter::NEGATIVE_PREFIX)."\n"; echo numfmt_format($fmt, -1234567.891234567890000)."\n"; numfmt_set_text_attribute($fmt, NumberFormatter::NEGATIVE_PREFIX, "MINUS"); echo "Prefix: ".numfmt_get_text_attribute($fmt, NumberFormatter::NEGATIVE_PREFIX)."\n"; echo numfmt_format($fmt, -1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Prefix: ".$fmt->getTextAttribute(NumberFormatter::NEGATIVE_PREFIX)."\n"; echo $fmt->format(-1234567.891234567890000)."\n"; $fmt->setTextAttribute(NumberFormatter::NEGATIVE_PREFIX, "MINUS"); echo "Prefix: ".$fmt->getTextAttribute(NumberFormatter::NEGATIVE_PREFIX)."\n"; echo $fmt->format(-1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Prefix: - -1.234.567,891 Prefix: MINUS MINUS1.234.567,891 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_get_attribute</function></member> <member><function>numfmt_set_text_attribute</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/parse-currency.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/parse-currency.xml +++ phpdoc/en/reference/intl/numberformatter/parse-currency.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.parsecurrency" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::parseCurrency</refname> <refname>numfmt_parse_currency</refname> <refpurpose>Parse a currency number</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>double</type> <methodname>parseCurrency</methodname> <methodparam><type>string</type><parameter>value</parameter></methodparam> <methodparam><type>string</type><parameter role="reference">currency</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter role="reference">position</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>double</type> <methodname>numfmt_parse_currency</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> <methodparam><type>string</type><parameter role="reference">currency</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter role="reference">position</parameter></methodparam> </methodsynopsis> <para> Parse a string into a double and a currency using the current formatter. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>position</parameter></term> <listitem> <para> Parameter to receive the currency name (3-letter ISO 4217 currency code). </para> </listitem> </varlistentry> <varlistentry> <term><parameter>position</parameter></term> <listitem> <para> Offset in the string at which to begin parsing. On return, this value will hold the offset at which parsing ended. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The parsed numeric value or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_parse_currency</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::CURRENCY ); $num = "1.234.567,89 $"; echo "We have ".numfmt_parse_currency($fmt, $num, $curr)." in $curr\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::CURRENCY ); $num = "1.234.567,89 $"; echo "We have ".$fmt->parseCurrency($num, $curr)." in $curr\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ We have 1234567.89 in USD ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_parse</function></member> <member><function>numfmt_format_currency</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/parse.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/parse.xml +++ phpdoc/en/reference/intl/numberformatter/parse.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.parse" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::parse</refname> <refname>numfmt_parse</refname> <refpurpose>Parse a number</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>mixed</type> <methodname>parse</methodname> <methodparam><type>string</type><parameter>value</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter role="reference">position</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>mixed</type> <methodname>numfmt_parse</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter role="reference">position</parameter></methodparam> </methodsynopsis> <para> Parse a string into a number using the current formatter rules. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>type</parameter></term> <listitem> <para> The <link linkend="intl.numberformatter-constants.types"> formatting type</link> to use. By default, <constant>NumberFormatter::TYPE_DOUBLE</constant> is used. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>position</parameter></term> <listitem> <para> Offset in the string at which to begin parsing. On return, this value will hold the offset at which parsing ended. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The value of the parsed number or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_parse</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); $num = "1.234.567,891"; echo numfmt_parse($fmt, $num)."\n"; echo numfmt_parse($fmt, $num, NumberFormatter::TYPE_INT32)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); $num = "1.234.567,891"; echo $fmt->parse($num)."\n"; echo $fmt->parse($num, NumberFormatter::TYPE_INT32)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 1234567.891 1234567 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_format</function></member> <member><function>numfmt_parse_currency</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/set-attribute.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/set-attribute.xml +++ phpdoc/en/reference/intl/numberformatter/set-attribute.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.setattribute" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::setAttribute</refname> <refname>numfmt_set_attribute</refname> <refpurpose>Set an attribute</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>bool</type> <methodname>setAttribute</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>integer</type><parameter>value</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>numfmt_set_attribute</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>integer</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> Set a numeric attribute associated with the formatter. An example of a numeric attribute is the number of integer digits the formatter will produce. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Attribute specifier - one of the <link linkend="intl.numberformatter-constants.UNumberFormatAttribute"> numeric attribute</link> constants. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> The attribute value. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_set_attribute</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Digits: ".numfmt_get_attribute($fmt, NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; numfmt_set_attribute($fmt, NumberFormatter::MAX_FRACTION_DIGITS, 2); echo "Digits: ".numfmt_get_attribute($fmt, NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Digits: ".$fmt->getAttribute(NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; $fmt->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, 2); echo "Digits: ".$fmt->getAttribute(NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Digits: 3 1.234.567,891 Digits: 2 1.234.567,89 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_get_attribute</function></member> <member><function>numfmt_set_text_attribute</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/set-pattern.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/set-pattern.xml +++ phpdoc/en/reference/intl/numberformatter/set-pattern.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.setpattern" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::setPattern</refname> <refname>numfmt_set_pattern</refname> <refpurpose>Set formatter pattern</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>bool</type> <methodname>setPattern</methodname> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>numfmt_set_pattern</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> <para> Set the pattern used by the formatter. Can not be used on a rule-based formatter. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>pattern</parameter></term> <listitem> <para> Pattern in syntax described in <link xlink:href="&url.icu.decimalformat;">ICU DecimalFormat documentation</link>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_set_pattern</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Pattern: ".numfmt_get_pattern($fmt)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; numfmt_set_pattern($fmt, "#0.# kg"); echo "Pattern: ".numfmt_get_pattern($fmt)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Pattern: ".$fmt->getPattern()."\n"; echo $fmt->format(1234567.891234567890000)."\n"; $fmt->setPattern("#0.# kg"); echo "Pattern: ".$fmt->getPattern()."\n"; echo $fmt->format(1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Pattern: #,##0.### 1.234.567,891 Pattern: #0.# kg 1234567,9 kg ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_create</function></member> <member><function>numfmt_get_pattern</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/set-symbol.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/set-symbol.xml +++ phpdoc/en/reference/intl/numberformatter/set-symbol.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.setsymbol" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::setSymbol</refname> <refname>numfmt_set_symbol</refname> <refpurpose>Set a symbol value</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>bool</type> <methodname>setSymbol</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>numfmt_set_symbol</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> Set a symbol associated with the formatter. The formatter uses symbols to represent the special locale-dependent characters in a number, for example the percent sign. This API is not supported for rule-based formatters. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Symbol specifier, one of the <link linkend="intl.numberformatter-constants.UNumberFormatSymbol"> format symbol</link> constants. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> Text for the symbol. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_set_symbol</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Sep: ".numfmt_get_symbol($fmt, NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; numfmt_set_symbol($fmt, NumberFormatter::GROUPING_SEPARATOR_SYMBOL, "*"); echo "Sep: ".numfmt_get_symbol($fmt, NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Sep: ".$fmt->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; $fmt->setSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL, "*"); echo "Sep: ".$fmt->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Sep: . 1.234.567,891 Sep: * 1*234*567,891 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_get_symbol</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/set-text-attribute.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/set-text-attribute.xml +++ phpdoc/en/reference/intl/numberformatter/set-text-attribute.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.settextattribute" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::setTextAttribute</refname> <refname>numfmt_set_text_attribute</refname> <refpurpose>Set a text attribute</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>bool</type> <methodname>setTextAttribute</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>numfmt_set_text_attribute</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> Set a text attribute associated with the formatter. An example of a text attribute is the suffix for positive numbers. If the formatter does not understand the attribute, <constant>U_UNSUPPORTED_ERROR</constant> error is produced. Rule-based formatters only understand <constant>NumberFormatter::DEFAULT_RULESET</constant> and <constant>NumberFormatter::PUBLIC_RULESETS</constant>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Attribute specifier - one of the <link linkend="intl.numberformatter-constants.UNumberFormatTextAttribute">text attribute</link> constants. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> Text for the attribute value. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_set_text_attribute</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Prefix: ".numfmt_get_text_attribute($fmt, NumberFormatter::NEGATIVE_PREFIX)."\n"; echo numfmt_format($fmt, -1234567.891234567890000)."\n"; numfmt_set_text_attribute($fmt, NumberFormatter::NEGATIVE_PREFIX, "MINUS"); echo "Prefix: ".numfmt_get_text_attribute($fmt, NumberFormatter::NEGATIVE_PREFIX)."\n"; echo numfmt_format($fmt, -1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Prefix: ".$fmt->getTextAttribute(NumberFormatter::NEGATIVE_PREFIX)."\n"; echo $fmt->format(-1234567.891234567890000)."\n"; $fmt->setTextAttribute(NumberFormatter::NEGATIVE_PREFIX, "MINUS"); echo "Prefix: ".$fmt->getTextAttribute(NumberFormatter::NEGATIVE_PREFIX)."\n"; echo $fmt->format(-1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Prefix: - -1.234.567,891 Prefix: MINUS MINUS1.234.567,891 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_get_text_attribute</function></member> <member><function>numfmt_set_attribute</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:"../../../../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 -->
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/.cvsignore?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/.cvsignore diff -u /dev/null phpdoc/en/reference/intl/.cvsignore:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/.cvsignore Wed Dec 26 20:43:36 2007 @@ -0,0 +1,2 @@ +entities.*.xml +*.php http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/book.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/book.xml diff -u /dev/null phpdoc/en/reference/intl/book.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/book.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,247 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> + +<book xml:id="book.intl" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>Internationalization Functions</title> + <titleabbrev>intl</titleabbrev> + + <!-- {{{ Preface --> + <preface xml:id="intro.intl"> + &reftitle.intro; + <para> + Internationalization extension (further is referred as Intl) is a wrapper + for <link xlink:href="&url.icu.home;">ICU</link> + library, enabling PHP programmers to perform UCA-conformant collation and + date/time/number/currency formatting in their scripts. + </para> + + <para> + It tends to closely follow ICU APIs, so that people having experience + working with ICU in either C/C++ or Java could easily use the PHP API. + Also, this way ICU documentation would be useful to understand various ICU + functions. + </para> + + <para> + Intl consists of several modules, each of them exposes the corresponding + ICU API: + </para> + + <itemizedlist> + <listitem> + <simpara> + Collator: provides string comparison capability with support for + appropriate locale-sensitive sort orderings. + </simpara> + </listitem> + <listitem> + <simpara> + Number Formatter: allows to display number according to the localized + format or given pattern or set of rules, and to parse strings into + numbers. + </simpara> + </listitem> + <listitem> + <simpara> + Normalizer: provides a function to transform text into one of the Unicode + normalization forms, and provides a routine to test if a given string is + already normalized. + </simpara> + </listitem> + <listitem> + <simpara> + Locale: provides interaction with locale identifiers in the form of + functions to get subtags from locale identifier; parse, compose, + match(lookup and filter) locale identifiers. + </simpara> + </listitem> + </itemizedlist> + + <!-- {{{ Links --> + <section xml:id="intl.links"> + <title>Links</title> + <itemizedlist> + <listitem> + <para><link xlink:href="&url.icu.docs;">Miscellaneous ICU docs</link></para> + </listitem> + <listitem> + <para><link xlink:href="&url.icu.userguide;">ICU User Guide</link></para> + </listitem> + <listitem> + <para><link xlink:href="&url.icu.uca;">Unicode Collation Algorithm</link></para> + </listitem> + </itemizedlist> + </section> + <!-- }}} --> + + </preface> + <!-- }}} --> + + <!-- {{{ Setup --> + <chapter xml:id="intl.setup" xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>Installing/Configuring</title> + + <!-- {{{ Requirements --> + <section xml:id="intl.requirements"> + &reftitle.required; + <para> + To build the extension you need to install the + <link xlink:href="&url.icu.home;">ICU</link> + library of version 3.6+. + </para> + <para> + You will also need the latest version of PHP. Collator is known to work + well on PHP 5.1.3+ and 5.2.0+. + </para> + </section> + <!-- }}} --> + + <!-- {{{ Installation --> + <section xml:id="intl.installation"> + &reftitle.install; + <para> + Run: + <screen> +<![CDATA[ +$ make install +]]> + </screen> + </para> + + <para> + Then enable the extension by adding the following line to [PHP] section of + your &php.ini;: + <screen> +<![CDATA[ +extension=intl.so +]]> + </screen> + </para> + </section> + <!-- }}} --> + + <!-- {{{ Testing --> + <section xml:id="intl.testing"> + <title>Testing</title> + <para> + Run: + <screen> +<![CDATA[ +$ make test +]]> + </screen> + </para> + <para> + Note that the tests may fail if: + </para> + <itemizedlist> + <listitem> + <para> + The Collator extension is already enabled in + &php.ini; + </para> + </listitem> + <listitem> + <para> + LD_LIBRARY_PATH is used to load ICU libraries and value of the + 'variables_order' setting in php.ini doesn't contain letter 'E' (missing + 'E' means "do not register Environment variables"); + </para> + </listitem> + </itemizedlist> + </section> + <!-- }}} --> + + &reference.intl.configure; + + <!-- {{{ Resources --> + <section xml:id="intl.resources"> + &reftitle.resources; + &no.resource; + </section> + <!-- }}} --> + + </chapter> + <!-- }}} --> + + &reference.intl.constants; + + <!-- {{{ Examples --> + <appendix xml:id="intl.examples" xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.examples; + <section xml:id="intl.examples.basic"> + <title>Basic usage of this extension</title> + <para> + Each module provides two kind of APIs: a procedural one and an object + oriented one. Both are actually identical and described in the + corresponding document. + </para> + <note> + <para> + All input strings must be in UTF-8 encoding. All output strings are + also in UTF-8. + </para> + </note> + <example> + <title>Example of using the procedural API</title> + <programlisting role="php"> +<![CDATA[ +<?php +$coll = collator_create('en_US'); +$result = collator_compare($coll, "string#1", "string#2"); +?> +]]> + </programlisting> + </example> + + <example> + <title>Example of using the object-oriented API</title> + <programlisting role="php"> +<![CDATA[ +<?php +$coll = new Collator('en_US'); +$al = $coll->getLocaleByType(Locale::ACTUAL_LOCALE); +echo "Actual locale: $al\n"; + +$formatter = new NumberFormatter('en_US', NumberFormatter::DECIMAL); +echo $formatter->format(1234567); +?> +]]> + </programlisting> + </example> + </section> + </appendix> + <!-- }}} --> + + &reference.intl.reference; + + &reference.intl.collator; + &reference.intl.numberformatter; + &reference.intl.locale; + &reference.intl.normalizer; + &reference.intl.messageformatter; + +</book> + +<!-- 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:"../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator-constants.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/collator-constants.xml diff -u /dev/null phpdoc/en/reference/intl/collator-constants.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/collator-constants.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,447 @@ +<?xml version="1.0" encoding="UTF-8"?> +<section xml:id="intl.collator-constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> +<!-- $Revision: 1.2 $ --> + &reftitle.constants; + <para> + <variablelist> + <varlistentry> + <term> + <constant>Collator::FRENCH_COLLATION</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + Sort strings with different accents from the back of the string. This + attribute is automatically set to + <emphasis>On</emphasis> + for the French locales and a few others. Users normally would not need + to explicitly set this attribute. There is a string comparison + performance cost when it is set <emphasis>On</emphasis>, + but sort key length is unaffected. Possible values are: + <simplelist> + <member><constant>Collator::ON</constant></member> + <member><constant>Collator::OFF</constant>(default)</member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + <para> + <example> + <title>FRENCH_COLLATION rules</title> + <para> + <simplelist> + <member>F=OFF cote < coté < côte < côté </member> + <member>F=ON cote < côte < coté < côté</member> + </simplelist> + </para> + </example> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::ALTERNATE_HANDLING</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + The Alternate attribute is used to control the handling of the socalled + variable characters in the UCA: whitespace, punctuation and symbols. If + Alternate is set to <emphasis>NonIgnorable</emphasis> + (N), then differences among these characters are of the same importance + as differences among letters. If Alternate is set to + <emphasis>Shifted</emphasis> + (S), then these characters are of only minor importance. The + <emphasis>Shifted</emphasis> value is often used in combination with + <emphasis>Strength</emphasis> + set to Quaternary. In such a case, whitespace, punctuation, and symbols + are considered when comparing strings, but only if all other aspects of + the strings (base letters, accents, and case) are identical. If + Alternate is not set to Shifted, then there is no difference between a + Strength of 3 and a Strength of 4. For more information and examples, + see Variable_Weighting in the + <link xlink:href="&url.icu.uca;">UCA</link> + . The reason the Alternate values are not simply + <emphasis>On</emphasis> and <emphasis>Off</emphasis> + is that additional Alternate values may be added in the future. The UCA + option Blanked is expressed with Strength set to 3, and Alternate set to + Shifted. The default for most locales is NonIgnorable. If Shifted is + selected, it may be slower if there are many strings that are the same + except for punctuation; sort key length will not be affected unless the + strength level is also increased. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::NON_IGNORABLE</constant>(default)</member> + <member><constant>Collator::SHIFTED</constant></member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + <para> + <example> + <title>ALTERNATE_HANDLING rules</title> + <para> + <simplelist> + <member> + S=3, A=N di Silva < Di Silva < diSilva < U.S.A. < USA + </member> + <member> + S=3, A=S di Silva = diSilva < Di Silva < U.S.A. = USA + </member> + <member> + S=4, A=S di Silva < diSilva < Di Silva < U.S.A. < USA + </member> + </simplelist> + </para> + </example> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::CASE_FIRST</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + The Case_First attribute is used to control whether uppercase letters + come before lowercase letters or vice versa, in the absence of other + differences in the strings. The possible values are + <emphasis>Uppercase_First</emphasis> + (U) and <emphasis>Lowercase_First</emphasis> + (L), plus the standard <emphasis>Default</emphasis> + and <emphasis>Off</emphasis>. + There is almost no difference between the Off and Lowercase_First + options in terms of results, so typically users will not use + Lowercase_First: only Off or Uppercase_First. (People interested in the + detailed differences between X and L should consult the Collation + Customization). Specifying either L or U won't affect string comparison + performance, but will affect the sort key length. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::OFF</constant>(default)</member> + <member><constant>Collator::LOWER_FIRST</constant></member> + <member><constant>Collator::UPPER_FIRST</constant></member> + <member><constant>Collator:DEFAULT</constant></member> + </simplelist> + </para> + <para> + <example> + <title>CASE_FIRST rules</title> + <para> + <simplelist> + <member>C=X or C=L "china" < "China" < "denmark" < "Denmark"</member> + <member>C=U "China" < "china" < "Denmark" < "denmark"</member> + </simplelist> + </para> + </example> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::CASE_LEVEL</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + The Case_Level attribute is used when ignoring accents but not case. In + such a situation, set Strength to be <emphasis>Primary</emphasis>, + and Case_Level to be <emphasis>On</emphasis>. + In most locales, this setting is Off by default. There is a small + string comparison performance and sort key impact if this attribute is + set to be <emphasis>On</emphasis>. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::OFF</constant>(default)</member> + <member><constant>Collator::ON</constant></member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + <para> + <example> + <title>CASE_LEVEL rules</title> + <para> + <simplelist> + <member>S=1, E=X role = Role = rôle</member> + <member>S=1, E=O role = rôle < Role</member> + </simplelist> + </para> + </example> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::NORMALIZATION_MODE</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + The Normalization setting determines whether text is thoroughly + normalized or not in comparison. Even if the setting is off (which is + the default for many locales), text as represented in common usage will + compare correctly (for details, see UTN #5). Only if the accent marks + are in noncanonical order will there be a problem. If the setting is + <emphasis>On</emphasis>, + then the best results are guaranteed for all possible text input. + There is a medium string comparison performance cost if this attribute + is <emphasis>On</emphasis>, + depending on the frequency of sequences that require normalization. + There is no significant effect on sort key length. If the input text is + known to be in NFD or NFKD normalization forms, there is no need to + enable this Normalization option. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::OFF</constant>(default)</member> + <member><constant>Collator::ON</constant></member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::STRENGTH</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + The ICU Collation Service supports many levels of comparison (named + "Levels", but also known as "Strengths"). Having these categories + enables ICU to sort strings precisely according to local conventions. + However, by allowing the levels to be selectively employed, searching + for a string in text can be performed with various matching conditions. + For more detailed information, see + <function>collator_set_strength</function> chapter. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::PRIMARY</constant></member> + <member><constant>Collator::SECONDARY</constant></member> + <member><constant>Collator::TERTIARY</constant>(default)</member> + <member><constant>Collator::QUATERNARY</constant></member> + <member><constant>Collator::IDENTICAL</constant></member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::HIRAGANA_QUATERNARY_MODE</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + Compatibility with JIS x 4061 requires the introduction of an additional + level to distinguish Hiragana and Katakana characters. If compatibility + with that standard is required, then this attribute should be set + <emphasis>On</emphasis>, + and the strength set to Quaternary. This will affect sort key length + and string comparison string comparison performance. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::OFF</constant>(default)</member> + <member><constant>Collator::ON</constant></member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::NUMERIC_COLLATION</constant> + (<type>integer</type>) + </term> + <listitem> + <para> + When turned on, this attribute generates a collation key for the numeric + value of substrings of digits. This is a way to get '100' to sort AFTER + '2'. + </para> + <para> + Possible values are: + <simplelist> + <member><constant>Collator::OFF</constant>(default)</member> + <member><constant>Collator::ON</constant></member> + <member><constant>Collator::DEFAULT_VALUE</constant></member> + </simplelist> + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::DEFAULT_VALUE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::PRIMARY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::SECONDARY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::TERTIARY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::DEFAULT_STRENGTH</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::QUATERNARY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::IDENTICAL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::OFF</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::ON</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::SHIFTED</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::NON_IGNORABLE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::LOWER_FIRST</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Collator::UPPER_FIRST</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + </variablelist> + </para> +</section> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/collator.xml diff -u /dev/null phpdoc/en/reference/intl/collator.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/collator.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> + +<reference xml:id="class.collator" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>The Collator class</title> + <titleabbrev>Collator</titleabbrev> + + <partintro> + + <!-- {{{ Collator intro --> + <section xml:id="collator.intro"> + &reftitle.intro; + <para> + Provides string comparison capability with support for appropriate + locale-sensitive sort orderings. + </para> + </section> + <!-- }}} --> + + <section xml:id="collator.synopsis"> + <title>Class synopsis</title> + + <!-- {{{ Synopsis --> + <classsynopsis> + <ooclass> + <classname>Collator</classname> + </ooclass> + + <!-- {{{ Class synopsis --> + <!-- + <classsynopsisinfo> + <ooclass> + <classname>Collator</classname> + </ooclass> + </classsynopsisinfo> + --> + <!-- }}} --> + + <!-- + <classsynopsisinfo role="comment">Properties</classsynopsisinfo> + <fieldsynopsis> + <modifier>public</modifier> + <type>string</type> + <varname linkend="collator.props.name">name</varname> + </fieldsynopsis> + + <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.collator')/db:refentry/db:refsect1[@role='description']/descendant::db:fieldsynopsis[1])" /> + --> + + <classsynopsisinfo role="comment">Methods</classsynopsisinfo> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.collator')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" /> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.collator')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> + </classsynopsis> + <!-- }}} --> + + </section> + + <!-- {{{ Collator properties + <section xml:id="collator.props"> + &reftitle.properties; + <variablelist> + <varlistentry xml:id="collator.props.name"> + <term><varname>name</varname></term> + <listitem> + <para>Prop description</para> + </listitem> + </varlistentry> + </variablelist> + </section> + }}} --> + + &reference.intl.collator-constants; + </partintro> + + &reference.intl.entities.collator; + +</reference> + +<!-- 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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/configure.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/configure.xml diff -u /dev/null phpdoc/en/reference/intl/configure.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/configure.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<section xml:id="intl.building" xmlns="http://docbook.org/ns/docbook"> + <title>Building</title> + + <para> + Let's assume that you have installed PHP to + <emphasis>/opt/php5/</emphasis> + and ICU is installed to + <emphasis>/opt/icu/</emphasis>. Run the following commands: + </para> + <screen> +<![CDATA[ +$ /opt/php5/bin/phpize +$ ./configure --with-php-config=/opt/php5/bin/php-config --with-icu-dir=/opt/icu +$ make +]]> + </screen> + <para> + If your ICU is installed to a non-standard directory then you might want to + specify its location in + <constant>LD_LIBRARY_PATH</constant> + environment variable so that dynamic linker can find it: + </para> + <screen>$ export LD_LIBRARY_PATH=/opt/icu/lib</screen> + <para> + Otherwise, if PHP and ICU are installed to their default locations, then the + additional options to `configure' are not needed. + </para> +</section> + +<!-- 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:"../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/constants.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/constants.xml diff -u /dev/null phpdoc/en/reference/intl/constants.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/constants.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<appendix xml:id="intl.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.constants; + &no.constants; +</appendix> + +<!-- 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:"../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale-constants.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/locale-constants.xml diff -u /dev/null phpdoc/en/reference/intl/locale-constants.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/locale-constants.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<section xml:id="intl.locale-constants" xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.constants; + <para> + These constants define how the Locale + <variablelist> + <varlistentry> + <term> + <constant>Locale::DEFAULT_LOCALE</constant> + (<type>string</type>) + </term> + <listitem> + <simpara> + Used with the getLocale methods of the various locale affected classes, + such as numfmt. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::ACTUAL_LOCALE</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>This is locale the data actually comes from.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::VALID_LOCALE</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>This is the most specific locale supported by ICU.</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + + <section xml:id="intl.locale-constants.subtags"> + <para> + These constants define how the Locales are parsed or composed. They should + be used as keys in the argument array to <function>locale_compose</function> + and are returned from <function>locale_parse</function> + as keys of the returned associative <type>array</type>. + <variablelist> + <varlistentry> + <term> + <constant>Locale::LANG_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Language subtag</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::EXTLANG_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Extended language subtag</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::SCRIPT_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Script subtag</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term> + <constant>Locale::REGION_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Region subtag</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::VARIANT_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Variant subtag</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::GRANDFATHERED_LANG_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Grandfathered Language subtag</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Locale::PRIVATE_TAG</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Private subtag</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> +</section> + +<!-- 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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/locale.xml diff -u /dev/null phpdoc/en/reference/intl/locale.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/locale.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<reference xml:id="class.locale" xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>The Locale class</title> + <titleabbrev>Locale</titleabbrev> + + <partintro> + + <!-- {{{ Locale intro --> + <section xml:id="locale.intro"> + &reftitle.intro; + <simpara> + A "Locale" is an identifier used to get language, culture, or + regionally-specific behavior from an API. PHP locales are organized and + identified the same way that the CLDR locales used by ICU (and many + vendors of Unix-like operating systems, the Mac, Java, and so forth) use. + Locales are identified using RFC 4646 language tags (which use hyphen, not + underscore) in addition to the more traditional underscore-using + identifiers. Unless otherwise noted the functions in this class are + tolerant of both formats. + </simpara> + <para> + Examples of identifiers include: + <simplelist> + <member>en-US (English, United States)</member> + <member>zh-Hant-TW (Chinese, Traditional Script, Taiwan)</member> + <member>fr-CA, fr-FR (French for Canada and France respectively)</member> + </simplelist> + </para> + <simpara> + The Locale class (and related procedural functions) are used to interact + with locale identifiers--to verify that an ID is well-formed, valid, etc. + The extensions used by CLDR in UAX #35 (and inherited by ICU) are valid + and used wherever they would be in ICU normally. + </simpara> + <simpara> + Locales cannot be instantiated as objects. All of the functions/methods + provided are static. + </simpara> + <simpara> + The null or empty string obtains the "root" locale. The "root" locale is + equivalent to "en_US_POSIX" in CLDR. Language tags (and thus locale + identifiers) are case insensitive. There exists a canonicalization + function to make case match the specification. + </simpara> + </section> + <!-- }}} --> + + <section xml:id="locale.synopsis"> + <title>Class synopsis</title> + + <!-- {{{ Synopsis --> + <classsynopsis> + <ooclass> + <classname>Locale</classname> + </ooclass> + + <!-- {{{ Class synopsis --> + <!-- + <classsynopsisinfo> + <ooclass> + <classname>Locale</classname> + </ooclass> + </classsynopsisinfo> + --> + <!-- }}} --> + + <!-- + <classsynopsisinfo role="comment">Properties</classsynopsisinfo> + <fieldsynopsis> + <modifier>public</modifier> + <type>string</type> + <varname linkend="locale.props.name">name</varname> + </fieldsynopsis> + + <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.Locale')/db:refentry/db:refsect1[@role='description']/descendant::db:fieldsynopsis[1])" /> + --> + + <classsynopsisinfo role="comment">Methods</classsynopsisinfo> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.locale')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> + </classsynopsis> + <!-- }}} --> + + </section> + + <!-- {{{ Locale properties + <section xml:id="Locale.props"> + &reftitle.properties; + <variablelist> + <varlistentry xml:id="locale.props.name"> + <term><varname>name</varname></term> + <listitem> + <para>Prop description</para> + </listitem> + </varlistentry> + </variablelist> + </section> + }}} --> + + &reference.intl.locale-constants; + <section xml:id="locale.seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member> + <link xlink:href="&url.rfc;4646"> + RFC 4646 - Tags for Identifying Languages + </link> + </member> + <member> + <link xlink:href="&url.rfc;4647"> + RFC 4647 - Matching of Language Tags + </link> + </member> + <member> + <link xlink:href="&url.cldr.locale;"> + Unicode CLDR Project:Common Locale Data Repository + </link> + </member> + <member> + <link xlink:href="&url.iana.locale.subtags;"> + IANA Language Subtags Registry + </link> + </member> + <member> + <link xlink:href="&url.icu.locale.guide;">ICU User Guide - Locale</link> + </member> + <member> + <link xlink:href="&url.icu.locale.api;">ICU Locale api</link> + </member> + </simplelist> + </para> + </section> + </partintro> + + &reference.intl.entities.locale; + +</reference> + +<!-- 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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/messageformatter.xml diff -u /dev/null phpdoc/en/reference/intl/messageformatter.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/messageformatter.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<reference xml:id="class.messageformatter" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>The MessageFormatter class</title> + <titleabbrev>MessageFormatter</titleabbrev> + + <partintro> + + <!-- {{{ MessageFormatter intro --> + <section xml:id="messageformatter.intro"> + &reftitle.intro; + <simpara> + MessageFormatter is a concrete class that enables users to produce + concatenated, language-neutral messages. The methods supplied in this + class are used to build all the messages that are seen by end users. + </simpara> + <simpara> + The MessageFormatter class assembles messages from various fragments (such + as text fragments, numbers, and dates) supplied by the program. Because of + the MessageFormatter class, the program does not need to know the order of + the fragments. The class uses the formatting specifications for the + fragments to assemble them into a message that is contained in a single + string within a resource bundle. For example, MessageFormatter enables you + to print the phrase "Finished printing x out of y files..." in a manner + that still allows for flexibility in translation. + </simpara> + <simpara> + Previously, an end user message was created as a sentence and handled as a + string. This procedure created problems for localizers because the + sentence structure, word order, number format and so on are very different + from language to language. The language-neutral way to create messages + keeps each part of the message separate and provides keys to the data. + Using these keys, the MessageFormatter class can concatenate the parts of + the message, localize them, and display a well-formed string to the end + user. + </simpara> + <simpara> + MessageFormatter takes a set of objects, formats them, and then inserts + the formatted strings into the pattern at the appropriate places. Choice + formats can be used in conjunction with MessageFormatter to handle + plurals, match numbers, and select from an array of items. Typically, the + message format will come from resources and the arguments will be + dynamically set at runtime. + </simpara> + </section> + <!-- }}} --> + + <section xml:id="messageformatter.synopsis"> + <title>Class synopsis</title> + + <!-- {{{ Synopsis --> + <classsynopsis> + <ooclass> + <classname>MessageFormatter</classname> + </ooclass> + + <!-- {{{ Class synopsis --> + <!-- }}} --> + + <classsynopsisinfo role="comment">Methods</classsynopsisinfo> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.messageformatter')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" /> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.messageformatter')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> + </classsynopsis> + <!-- }}} --> + + </section> + + <section xml:id="messageformatter.seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member> + <link xlink:href="&url.icu.formatparse;"> + ICU formatting documentation + </link> + </member> + <member> + <link xlink:href="&url.icu.formatmsg;"> + ICU message formatting description + </link> + </member> + <member> + <link xlink:href="&url.icu.msgformat;">ICU message formatters</link> + </member> + <member> + <link xlink:href="&url.icu.choiceformat;">ICU choice formatters</link> + </member> + </simplelist> + </para> + </section> + </partintro> + + &reference.intl.entities.messageformatter; + +</reference> + +<!-- 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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/normalizer-constants.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/normalizer-constants.xml diff -u /dev/null phpdoc/en/reference/intl/normalizer-constants.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/normalizer-constants.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<section xml:id="intl.normalizer-constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.constants; + + <para> + The following constants define the normalization form used by the + normalizer: + <variablelist> + <varlistentry> + <term> + <constant>Normalizer::FORM_C</constant> + (<type>string</type>) + </term> + <listitem> + <simpara> + Normalization Form C (NFC) - Canonical Decomposition followed by + Canonical Composition + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Normalizer::FORM_D</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Normalization Form D (NFD) - Canonical Decomposition</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Normalizer::FORM_KC</constant> + (<type>string</type>) + </term> + <listitem> + <simpara> + Normalization Form KC (NFKC) - Compatibility Decomposition, followed by + Canonical Composition + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Normalizer::FORM_KD</constant> + (<type>string</type>) + </term> + <listitem> + <simpara> + Normalization Form KD (NFKD) - Compatibility Decomposition + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Normalizer::NONE</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>No decomposition/composition</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>Normalizer::OPTION_DEFAULT</constant> + (<type>string</type>) + </term> + <listitem> + <simpara>Default normalization options</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> +</section> + +<!-- 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:"../../../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 +--> + http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/normalizer.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/normalizer.xml diff -u /dev/null phpdoc/en/reference/intl/normalizer.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/normalizer.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<reference xml:id="class.normalizer" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>The Normalizer class</title> + <titleabbrev>Normalizer</titleabbrev> + + <partintro> + + <!-- {{{ Normalizer intro --> + <section xml:id="normalizer.intro"> + &reftitle.intro; + <simpara> + Normalization is a process that involves transforming characters and + sequences of characters into a formally-defined underlying representation. + This process is most important when text needs to be compared for sorting + and searching, but it is also used when storing text to ensure that the + text is stored in a consistent representation. + </simpara> + <para> + The Unicode Consortium has defined a number of normalization forms + reflecting the various needs of applications: + <simplelist> + <member>Normalization Form D (NFD) - Canonical Decomposition</member> + <member> + Normalization Form C (NFC) - Canonical Decomposition followed by + Canonical Composition + </member> + <member> + Normalization Form KD (NFKD) - Compatibility Decomposition + </member> + <member> + Normalization Form KC (NFKC) - Compatibility Decomposition followed by + Canonical Composition + </member> + </simplelist> + The different forms are defined in terms of a set of transformations on + the text, transformations that are expressed by both an algorithm and a + set of data files. + </para> + </section> + <!-- }}} --> + + <section xml:id="normalizer.synopsis"> + <title>Class synopsis</title> + + <!-- {{{ Synopsis --> + <classsynopsis> + <ooclass> + <classname>Normalizer</classname> + </ooclass> + + <!-- {{{ Class synopsis --> + <!-- + <classsynopsisinfo> + <ooclass> + <classname>Normalizer</classname> + </ooclass> + </classsynopsisinfo> + --> + <!-- }}} --> + + <!-- + <classsynopsisinfo role="comment">Properties</classsynopsisinfo> + <fieldsynopsis> + <modifier>public</modifier> + <type>string</type> + <varname linkend="normalizer.props.name">name</varname> + </fieldsynopsis> + + <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.normalizer')/db:refentry/db:refsect1[@role='description']/descendant::db:fieldsynopsis[1])" /> + --> + + <classsynopsisinfo role="comment">Methods</classsynopsisinfo> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.normalizer')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> + </classsynopsis> + <!-- }}} --> + + </section> + + <!-- {{{ Normalizer properties + <section xml:id="Normalizer.props"> + &reftitle.properties; + <variablelist> + <varlistentry xml:id="normalizer.props.name"> + <term><varname>name</varname></term> + <listitem> + <para>Prop description</para> + </listitem> + </varlistentry> + </variablelist> + </section> + }}} --> + + &reference.intl.normalizer-constants; + + <section xml:id="normalizer.seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member> + <link xlink:href="&url.unicode.normalization;"> + Unicode Normalization + </link> + </member> + <member> + <link xlink:href="&url.unicode.normalization.faq;"> + Unicode Normalization FAQ + </link> + </member> + <member> + <link xlink:href="&url.icu.normalization.guide;"> + ICU User Guide - Normalization + </link> + </member> + <member> + <link xlink:href="&url.icu.normalization.api;"> + ICU API Reference - Normalization + </link> + </member> + </simplelist> + </para> + </section> + </partintro> + + &reference.intl.entities.normalizer; + +</reference> + +<!-- 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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter-constants.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/numberformatter-constants.xml diff -u /dev/null phpdoc/en/reference/intl/numberformatter-constants.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/numberformatter-constants.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,848 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Revision: 1.2 $ --> +<section xml:id="intl.numberformatter-constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + &reftitle.constants; + + <section xml:id="intl.numberformatter-constants.UNumberFormatStyle"> + <para> + These styles are used by the <function>numfmt_create</function> + to define the type of the formatter. + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::PATTERN_DECIMAL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Decimal format defined by pattern</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::DECIMAL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Decimal format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::CURRENCY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Currency format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PERCENT</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Percent format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::SCIENTIFIC</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Scientific format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::SPELLOUT</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Spellout rule-based format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ORDINAL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Ordinal rule-based format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::DURATION</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Duration rule-based format</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PATTERN_RULEBASED</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rule-based format defined by pattern</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::DEFAULT_STYLE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Default format for the locale</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::IGNORE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Alias for PATTERN_DECIMAL</simpara> + </listitem> + </varlistentry> + </variablelist> + + + + + + </para> + </section> + + <section xml:id="intl.numberformatter-constants.types"> + <para> + These constants define how the numbers are parsed or formatted. They should + be used as arguments to <function>numfmt_format</function> + and <function>numfmt_parse</function>. + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::TYPE_DEFAULT</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Derive the type from variable type</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::TYPE_INT32</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Format/parse as 32-bit integer</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::TYPE_INT64</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Format/parse as 64-bit integer</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::TYPE_DOUBLE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Format/parse as floating point value</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::TYPE_CURRENCY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Format/parse as currency value</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> + + <section xml:id="intl.numberformatter-constants.UNumberFormatAttribute"> + <para> + Number format attribute used by + <function>numfmt_get_attribute</function> + and + <function>numfmt_set_attribute</function> + . + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::PARSE_INT_ONLY</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Parse integers only.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::GROUPING_USED</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Use grouping separator.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::DECIMAL_ALWAYS_SHOWN</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Always show decimal point.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MAX_INTEGER_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Maximum integer digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MIN_INTEGER_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Minimum integer digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::INTEGER_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Integer digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MAX_FRACTION_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Maximum fraction digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MIN_FRACTION_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Minimum fraction digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::FRACTION_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Fraction digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MULTIPLIER</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Multiplier.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::GROUPING_SIZE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Grouping size.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUNDING_MODE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rounding Mode.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUNDING_INCREMENT</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rounding increment.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::FORMAT_WIDTH</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The width to which the output of format() is padded.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PADDING_POSITION</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + The position at which padding will take place. See pad position + constants for possible argument values. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::SECONDARY_GROUPING_SIZE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Secondary grouping size.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::SIGNIFICANT_DIGITS_USED</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Use significant digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MIN_SIGNIFICANT_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Minimum significant digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MAX_SIGNIFICANT_DIGITS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Maximum significant digits.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::LENIENT_PARSE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Lenient parse mode used by rule-based formats.</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> + + <section + xml:id="intl.numberformatter-constants.UNumberFormatTextAttribute"> + <para> + Number format text attribute used by + <function>numfmt_get_text_attribute</function> and + <function>numfmt_set_text_attribute</function>. + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::POSITIVE_PREFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Positive prefix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::POSITIVE_SUFFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Positive suffix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::NEGATIVE_PREFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Negative prefix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::NEGATIVE_SUFFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Negative suffix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PADDING_CHARACTER</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The character used to pad to the format width.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::CURRENCY_CODE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The ISO currency code.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::DEFAULT_RULESET</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + The default rule set. This is only available with rule-based + formatters. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PUBLIC_RULESETS</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + The public rule sets. This is only available with rule-based + formatters. This is a read-only attribute. The public rulesets are + returned as a single string, with each ruleset name delimited by ';' + (semicolon). + </simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> + + <section xml:id="intl.numberformatter-constants.UNumberFormatSymbol"> + <para> + Number format symbols used by <function>numfmt_get_symbol</function> + and <function>numfmt_set_symbol</function>. + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::DECIMAL_SEPARATOR_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The decimal separator.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::GROUPING_SEPARATOR_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The grouping separator.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PATTERN_SEPARATOR_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The pattern separator.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PERCENT_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The percent sign.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ZERO_DIGIT_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Zero.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::DIGIT_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Character representing a digit in the pattern.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MINUS_SIGN_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The minus sign.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PLUS_SIGN_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The plus sign.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::CURRENCY_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The currency symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::INTL_CURRENCY_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The international currency symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MONETARY_SEPARATOR_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The monetary separator.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::EXPONENTIAL_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The exponential symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PERMILL_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Per mill symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PAD_ESCAPE_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Escape padding character.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::INFINITY_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Infinity symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::NAN_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Not-a-number symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Significant digit symbol.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>The monetary grouping separator.</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> + + <section xml:id="intl.numberformatter-constants.UNumberFormatRoundingMode"> + <para> + Rounding mode values used by <function>numfmt_get_attribute</function> + and <function>numfmt_set_attribute</function> with + <constant>NumberFormatter::ROUNDING_MODE</constant> attribute. + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_CEILING</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rounding mode to round towards positive infinity.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_DOWN</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rounding mode to round towards zero.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_FLOOR</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rounding mode to round towards negative infinity.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_HALFDOWN</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + Rounding mode to round towards "nearest neighbor" unless both neighbors + are equidistant, in which case round down. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_HALFEVEN</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + Rounding mode to round towards the "nearest neighbor" unless both + neighbors are equidistant, in which case, round towards the even + neighbor. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_HALFUP</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + Rounding mode to round towards "nearest neighbor" unless both neighbors + are equidistant, in which case round up. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::ROUND_UP</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Rounding mode to round away from zero.</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> + + <section xml:id="intl.numberformatter-constants.UNumberFormatPadPosition"> + <para> + Pad position values used by <function>numfmt_get_attribute</function> + and <function>numfmt_set_attribute</function> with + <constant>NumberFormatter::PADDING_POSITION</constant> attribute. + <variablelist> + <varlistentry> + <term> + <constant>NumberFormatter::PAD_AFTER_PREFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Pad characters inserted after the prefix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PAD_AFTER_SUFFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Pad characters inserted after the suffix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PAD_BEFORE_PREFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Pad characters inserted before the prefix.</simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term> + <constant>NumberFormatter::PAD_BEFORE_SUFFIX</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara>Pad characters inserted before the suffix.</simpara> + </listitem> + </varlistentry> + </variablelist> + </para> + </section> + +</section> + +<!-- 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:"../../../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 +--> + http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/numberformatter.xml diff -u /dev/null phpdoc/en/reference/intl/numberformatter.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/numberformatter.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<reference xml:id="class.numberformatter" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> + <title>The NumberFormatter class</title> + <titleabbrev>NumberFormatter</titleabbrev> + + <partintro> + + <!-- {{{ NumberFormatter intro --> + <section xml:id="numberformatter.intro"> + &reftitle.intro; + <simpara> + Programs store and operate on numbers using a locale-independent binary + representation. When displaying or printing a number it is converted to a + locale-specific string. For example, the number 12345.67 is "12,345.67" in + the US, "12 345,67" in France and "12.345,67" in Germany. + </simpara> + <simpara> + By invoking the methods provided by the NumberFormatter class, you can + format numbers, currencies, and percentages according to the specified or + default locale. NumberFormatter is locale-sensitive so you need to create + a new NumberFormatter for each locale. NumberFormatter methods format + primitive-type numbers, such as double and output the number as a + locale-specific string. + </simpara> + <para> + For currencies you can use currency format type to create a formatter that + returns a string with the formatted number and the appropriate currency + sign. Of course, the NumberFormatter class is unaware of exchange rates + so, the number output is the same regardless of the specified currency. + This means that the same number has different monetary values depending on + the currency locale. If the number is 9988776.65 the results will be: + <simplelist> + <member>9 988 776,65 ⬠in France</member> + <member>9.988.776,65 ⬠in Germany</member> + <member>$9,988,776.65 in the United States</member> + </simplelist> + </para> + <simpara> + In order to format percentages, create a locale-specific formatter with + percentage format type. With this formatter, a decimal fraction such as + 0.75 is displayed as 75%. + </simpara> + <simpara> + For more complex formatting, like spelled-out numbers, the rule-based + number formatters are used. + </simpara> + </section> + <!-- }}} --> + + <section xml:id="NumberFormatter.synopsis"> + <title>Class synopsis</title> + + <!-- {{{ Synopsis --> + <classsynopsis> + <ooclass> + <classname>NumberFormatter</classname> + </ooclass> + + <!-- {{{ Class synopsis --> + <!-- + <classsynopsisinfo> + <ooclass> + <classname>NumberFormatter</classname> + </ooclass> + </classsynopsisinfo> + --> + <!-- }}} --> + + <!-- + <classsynopsisinfo role="comment">Properties</classsynopsisinfo> + <fieldsynopsis> + <modifier>public</modifier> + <type>string</type> + <varname linkend="NumberFormatter.props.name">name</varname> + </fieldsynopsis> + + <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.NumberFormatter')/db:refentry/db:refsect1[@role='description']/descendant::db:fieldsynopsis[1])" /> + --> + + <classsynopsisinfo role="comment">Methods</classsynopsisinfo> + <xi:include + xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.numberformatter')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> + </classsynopsis> + <!-- }}} --> + + </section> + + <!-- {{{ NumberFormatter properties + <section xml:id="NumberFormatter.props"> + &reftitle.properties; + <variablelist> + <varlistentry xml:id="NumberFormatter.props.name"> + <term><varname>name</varname></term> + <listitem> + <para>Prop description</para> + </listitem> + </varlistentry> + </variablelist> + </section> + }}} --> + + &reference.intl.numberformatter-constants; + + <section xml:id="numberformatter.seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member> + <link xlink:href="&url.icu.formatparse;"> + ICU formatting documentation + </link> + </member> + <member> + <link xlink:href="&url.icu.formatnumbers;">ICU number formatters</link> + </member> + <member> + <link xlink:href="&url.icu.decimalformat;">ICU decimal formatters</link> + </member> + <member> + <link xlink:href="&url.icu.ruleformat;"> + ICU rule-based number formatters + </link> + </member> + </simplelist> + </para> + </section> + </partintro> + + &reference.intl.entities.numberformatter; + +</reference> + +<!-- 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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/reference.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/reference.xml diff -u /dev/null phpdoc/en/reference/intl/reference.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/reference.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<reference xml:id="ref.intl" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + <title>intl &Functions;</title> + &reference.intl.entities.functions; +</reference> + +<!-- 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:"../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/functions/intl-error-name.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/functions/intl-error-name.xml diff -u /dev/null phpdoc/en/reference/intl/functions/intl-error-name.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/functions/intl-error-name.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.2 $ --> +<refentry xml:id="function.intl-error-name"> + <refnamediv> + <refname>intl_error_name</refname> + <refpurpose>Get symbolic name for a given error code</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type> + <methodname>intl_error_name</methodname> + <methodparam><type>integer</type><parameter>error_code</parameter></methodparam> + </methodsynopsis> + <para> + Return ICU error code name. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>error_code</parameter></term> + <listitem> + <para> + ICU error code. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The returned string will be the same as the name of the error code + constant. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>intl_error_name</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$coll = collator_create( 'en_RU' ); +$err_code = collator_get_error_code( $coll ); + +printf( "Symbolic name for %d is %s\n.", $err_code, intl_error_name( $err_code ) ); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +Symbolic name for -128 is U_USING_FALLBACK_WARNING. +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>intl_is_failure</function></member> + <member><function>intl_get_error_code</function></member> + <member><function>intl_get_error_message</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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/functions/intl-get-error-code.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/functions/intl-get-error-code.xml diff -u /dev/null phpdoc/en/reference/intl/functions/intl-get-error-code.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/functions/intl-get-error-code.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Revision: 1.2 $ --> +<refentry xml:id="function.intl-get-error-code"> + <refnamediv> + <refname>intl_get_error_code</refname> + <refpurpose>Get the last error code</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>integer</type> + <methodname>intl_get_error_code</methodname> + <void /> + </methodsynopsis> + <para> + Useful to handle errors occured in static methods when there's no object to + get error code from. + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Error code returned by the last API function call. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>intl_get_error_code</function> example</title> + <programlisting role="php"> + <![CDATA[ +<?php +$coll = collator_create( '<bad_param>' ); +if( !$coll ) { + handle_error( intl_get_error_code() ); +} +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>intl_is_failure</function></member> + <member><function>intl_error_name</function></member> + <member><function>intl_get_error_message</function></member> + <member><function>collator_get_error_code</function></member> + <member><function>numfmt_get_error_code</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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/functions/intl-get-error-message.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/functions/intl-get-error-message.xml diff -u /dev/null phpdoc/en/reference/intl/functions/intl-get-error-message.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/functions/intl-get-error-message.xml Wed Dec 26 20:43:36 2007 @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Revision: 1.2 $ --> +<refentry xml:id="function.intl-get-error-message"> + <refnamediv> + <refname>intl_get_error_message</refname> + <refpurpose>Get description of the last error</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type> + <methodname>intl_get_error_message</methodname> + <void /> + </methodsynopsis> + <para> + Get error message from last internationalization function called. + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Description of an error occurred in the last API function call. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>intl_get_error_message</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +if( Collator::getAvailableLocales() === false ) { + show_error( intl_get_error_message() ); +} +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>intl_error_name</function></member> + <member><function>intl_get_error_code</function></member> + <member><function>intl_is_failure</function></member> + <member><function>collator_get_error_message</function></member> + <member><function>numfmt_get_error_message</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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/functions/intl-is-failure.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/intl/functions/intl-is-failure.xml diff -u /dev/null phpdoc/en/reference/intl/functions/intl-is-failure.xml:1.2 --- /dev/null Wed Dec 26 20:43:37 2007 +++ phpdoc/en/reference/intl/functions/intl-is-failure.xml Wed Dec 26 20:43:37 2007 @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Revision: 1.2 $ --> +<refentry xml:id="function.intl-is-failure"> + <refnamediv> + <refname>intl_is_failure</refname> + <refpurpose>Check whether the given error code indicates failure</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>bool</type> + <methodname>intl_is_failure</methodname> + <methodparam><type>integer</type><parameter>error_code</parameter></methodparam> + </methodsynopsis> + <para> + <!-- description goes here --> + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>error_code</parameter></term> + <listitem> + <para> + is a value that returned by functions: + <function>intl_get_error_code</function>, + <function>collator_get_error_code</function> . + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &true; if it the code indicates some failure, and &false; + in case of success or a warning. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>intl_is_failure</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +function check( $err_code ) +{ + var_export( intl_is_failure( $err_code ) ); + echo "\n"; +} + +check( U_ZERO_ERROR ); +check( U_USING_FALLBACK_WARNING ); +check( U_ILLEGAL_ARGUMENT_ERROR ); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +false +false +true +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>intl_get_error_code</function></member> + <member><function>collator_get_error_code</function></member> + <member><function>Collator-getErrorCode</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:"../../../../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 +--> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/asort.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/asort.xml +++ phpdoc/en/reference/intl/collator/asort.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.asort" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::asort</refname> <refname>collator_asort</refname> <refpurpose>Sort array maintaining index association</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Object oriented style</para> <methodsynopsis> <type>bool</type> <methodname>Collator::asort</methodname> <methodparam><type>array</type><parameter>arr</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>sort_flag</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>collator_asort</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>array</type><parameter>arr</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>sort_flag</parameter></methodparam> </methodsynopsis> <para> This function sorts an array such that array indices maintain their correlation with the array elements they are associated with. This is used mainly when sorting associative arrays where the actual element order is significant. Array elements will have sort order according to current locale rules. </para> <para> Equivalent to standard PHP <function>asort</function>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>arr</parameter></term> <listitem> <para>Array of strings to sort.</para> </listitem> </varlistentry> <varlistentry> <term><parameter>sort_flag</parameter></term> <listitem> <para> Optional sorting type, one of the following: <itemizedlist> <listitem> <para> <constant>Collator::SORT_REGULAR</constant> - compare items normally (don't change types) </para> </listitem> <listitem> <para> <constant>Collator::SORT_NUMERIC</constant> - compare items numerically </para> </listitem> <listitem> <para> <constant>Collator::SORT_STRING</constant> - compare items as strings </para> </listitem> </itemizedlist> </para> <para> Default $sort_flag value is <constant>Collator::SORT_REGULAR</constant>. It is also used if an invalid $sort_flag value has been specified. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_asort</function>example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US' ); $arr = array( 'a' => '100', 'b' => '50', 'c' => '7' ); collator_asort( $coll, $arr, Collator::SORT_NUMERIC ); var_export( $arr ); collator_asort( $coll, $arr, Collator::SORT_STRING ); var_export( $arr ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ array ( 'c' => '7', 'b' => '50', 'a' => '100', )array ( 'a' => '100', 'b' => '50', 'c' => '7', ) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname>constants</link></member> <member><function>collator_sort</function></member> <member><function>collator_sort_with_sort_keys</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/compare.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/compare.xml +++ phpdoc/en/reference/intl/collator/compare.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.compare" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::compare</refname> <refname>collator_compare</refname> <refpurpose>Compare two Unicode strings</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Collator</classname> </ooclass> <methodsynopsis> <type>integer</type> <methodname>compare</methodname> <methodparam><type>string</type><parameter>str1</parameter></methodparam> <methodparam><type>string</type><parameter>str2</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>collator_compare</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>string</type><parameter>str1</parameter></methodparam> <methodparam><type>string</type><parameter>str2</parameter></methodparam> </methodsynopsis> <para> Compare two Unicode strings according to collation rules. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>str1</parameter></term> <listitem> <para> The first string to compare. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>str2</parameter></term> <listitem> <para> The second string to compare. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para>Return comparison result:</para> <para> <itemizedlist> <listitem> <para> 1 if <emphasis> str1</emphasis> is <emphasis> greater</emphasis> than <emphasis> str2</emphasis> ; </para> </listitem> <listitem> <para> 0 if <emphasis>str1</emphasis> is <emphasis>equal</emphasis> to <emphasis> str2</emphasis>; </para> </listitem> <listitem> <para> -1 if <emphasis> str1</emphasis> is <emphasis> less</emphasis> than <emphasis> str2</emphasis> . </para> </listitem> </itemizedlist> On error <type>boolean</type> &false; is returned. </para> &return.falseproblem; </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_compare</function>example</title> <programlisting role="php"> <![CDATA[ <?php $s1 = 'Hello'; $s2 = 'hello'; $coll = collator_create( 'en_US' ); $res = collator_compare( $coll, $s1, $s2 ); if ($res === false) { echo collator_get_error_message( $coll ); } else if( $res > 0 ) { echo "s1 is greater than s2\n"; } else if( $res < 0 ) { echo "s1 is less than s2\n"; } else { echo "s1 is equal to s2\n"; ?> ]]> </programlisting> &example.outputs; <screen> s1 is greater than s2 </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>collator_sort</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/construct.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/construct.xml +++ phpdoc/en/reference/intl/collator/construct.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>Collator::__construct</refname> <refpurpose>Create a collator</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <constructorsynopsis> <methodname>Collator::__construct</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </constructorsynopsis> <para> Creates a new instance of Collator. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale whose collation rules should be used. Special values for locales can be passed in - if null is passed for the locale, the default locale collation rules will be used. If empty string ("") or "root" are passed, UCA rules will be used. </para> <para> The Locale attribute is typically the most important attribute for correct sorting and matching, according to the user expectations in different countries and regions. The default <link xlink:href="&url.icu.uca;">UCA</link> ordering will only sort a few languages such as Dutch and Portuguese correctly ("correctly" meaning according to the normal expectations for users of the languages). Otherwise, you need to supply the locale to UCA in order to properly collate text for a given language. Thus a locale needs to be supplied so as to choose a collator that is correctly tailored for that locale. The choice of a locale will automatically preset the values for all of the attributes to something that is reasonable for that locale. Thus most of the time the other attributes do not need to be explicitly set. In some cases, the choice of locale will make a difference in string comparison performance and/or sort key length. <!-- In short attribute names, <language>_<script>_<region>_<keyword> is represented by: L<language>_Z<script>_R<region>_V<variant>_K<keyword>. for <emphasis>RFC4646</emphasis> locale naming. <example><title>Locale format</title> Example: Locale="sv" (Swedish) "Kypper" < "Köpfe" Locale="de" (German) "Köpfe" < "Kypper" </example> --> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns Collator instance. </para> </refsect1> <refsect1 role="errors"> &reftitle.errors; <para> Returns an "empty" object on error. You can use <function>intl_get_error_code</function> and/or <function>intl_get_error_message</function> to know what happened. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>Collator::__construct</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = new Collator( 'en_CA' ); ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>Collator::create</function></member> <member><function>collator_create</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/create.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/create.xml +++ phpdoc/en/reference/intl/collator/create.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.create" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::create</refname> <refname>collator_create</refname> <refpurpose>Create a collator</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Object oriented style</para> <methodsynopsis> <modifier>static</modifier> <type>Collator</type> <methodname>Collator::create</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>Collator</type> <methodname>collator_create</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> The strings will be compared using the options already specified. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale containing the required collation rules. Special values for locales can be passed in - if null is passed for the locale, the default locale collation rules will be used. If empty string ("") or "root" are passed, UCA rules will be used. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Return new instance of <classname>Collator</classname> object, or &null; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_create</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US' ); if( !isset( $coll ) ) { printf( "Collator creation failed: %s\n", intl_get_error_message() ); exit( 1 ); } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>Collator::__construct</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/get-attribute.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/get-attribute.xml +++ phpdoc/en/reference/intl/collator/get-attribute.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.getattribute" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::getAttribute</refname> <refname>collator_get_attribute</refname> <refpurpose>Get collation attribute value</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>integer</type> <methodname>Collator::getAttribute</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>collator_get_attribute</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> <para> Get a value of an integer collator attribute. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Attribute to get value for. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Attribute value, or <type>boolean</type> &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_get_attribute</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_CA' ); $val = collator_get_attribute( $coll, Collator::NUMERIC_COLLATION ); if( $val === false ) { // Handle error. } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname> constants</link></member> <member><function>collator_set_attribute</function></member> <member><function>collator_get_strength</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/get-error-code.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/get-error-code.xml +++ phpdoc/en/reference/intl/collator/get-error-code.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.geterrorcode" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::getErrorCode</refname> <refname>collator_get_error_code</refname> <refpurpose>Get collator's last error code</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>integer</type> <methodname>Collator::getErrorCode</methodname> <void /> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>collator_get_error_code</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> </methodsynopsis> <para> <!-- description goes here --> </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Error code returned by the last Collator <acronym>API</acronym> function call. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_get_error_code</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US' ); if( collator_get_attribute( $coll, Collator::FRENCH_COLLATION ) === false ) handle_error( collator_get_error_code() ); ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>collator_get_error_message</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/get-error-message.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/get-error-message.xml +++ phpdoc/en/reference/intl/collator/get-error-message.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.geterrormessage" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::getErrorMessage</refname> <refname>collator_get_error_message</refname> <refpurpose>Get text for collator's last error code</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>string</type> <methodname>Collator::getErrorMessage</methodname> <void /> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>collator_get_error_message</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> </methodsynopsis> <para> Retrieves the message for the last error. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Description of an error occurred in the last Collator <acronym>API</acronym> function call. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_get_error_message</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'lt' ); if( collator_compare( $coll, 'y', 'k' ) === false ) { echo collator_get_error_message( $coll ); } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>collator_get_error_code</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/get-locale.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/get-locale.xml +++ phpdoc/en/reference/intl/collator/get-locale.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.getlocale" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::getLocale</refname> <refname>collator_get_locale</refname> <refpurpose>Get the locale name of the collator</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Collator</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getLocale</methodname> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>collator_get_locale</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>integer</type><parameter>type</parameter></methodparam> </methodsynopsis> <para> Get collector locale name. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>type</parameter></term> <listitem> <para> You can choose between valid and actual locale ( <constant>Locale::VALID_LOCALE</constant> and <constant>Locale::ACTUAL_LOCALE</constant>, respectively). The default is the actual locale. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Real locale name from which the collation data comes. If the collator was instantiated from rules or an error occurred, returns <type>boolean</type> &false;. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_get_locale</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US_California' ); $res_val = collator_get_locale( $coll, Locale::VALID_LOCALE ); $res_act = collator_get_locale( $coll, Locale::ACTUAL_LOCALE ); printf( "Valid locale name: %s\nActual locale name: %s\n", $res_req, $res_val, $res_act ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ Requested locale name: en_US_California Valid locale name: en_US Actual locale name: en ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>collator_create</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/get-strength.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/get-strength.xml +++ phpdoc/en/reference/intl/collator/get-strength.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.getstrength" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::getStrength</refname> <refname>collator_get_strength</refname> <refpurpose>Get current collation strength</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>integer</type> <methodname>Collator::getStrength</methodname> <void /> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>collator_get_strength</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> </methodsynopsis> <para> <!-- description goes here --> </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns current collation strength, or <type>boolean</type> &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_get_strength</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US' ); $strength = collator_get_strength( $coll ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ // TODO ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname> constants</link></member> <member><function>collator_set_strength</function></member> <member><function>collator_get_attribute</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/set-attribute.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/set-attribute.xml +++ phpdoc/en/reference/intl/collator/set-attribute.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.setattribute" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::setAttribute</refname> <refname>collator_set_attribute</refname> <refpurpose>Set collation attribute</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>bool</type> <methodname>Collator::setAttribute</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>integer</type><parameter>val</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>collator_set_attribute</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>integer</type><parameter>val</parameter></methodparam> </methodsynopsis> <para> <!-- description goes here --> </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> <type>object</type>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para>Attribute.</para> </listitem> </varlistentry> <varlistentry> <term><parameter>val</parameter></term> <listitem> <para> Attribute value. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_set_attribute</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_CA' ); $val = collator_get_attribute( $coll, Collator::NUMERIC_COLLATION ); if ($val === false) { // Handle error. } elseif ($val === Collator::ON) { // Do something useful. } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname> constants</link></member> <member><function>collator_get_attribute</function></member> <member><function>collator_set_strength</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/set-strength.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/set-strength.xml +++ phpdoc/en/reference/intl/collator/set-strength.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.setstrength" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>Collator::setStrength</refname> <refname>collator_set_strength</refname> <refpurpose>Set collation strength</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>bool</type> <methodname>Collator::setStrength</methodname> <methodparam><type>integer</type><parameter>strength</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>collator_set_strength</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>integer</type><parameter>strength</parameter></methodparam> </methodsynopsis> <para> The <link xlink:href="&url.icu.home;">ICU</link> Collation Service supports many levels of comparison (named "Levels", but also known as "Strengths"). Having these categories enables ICU to sort strings precisely according to local conventions. However, by allowing the levels to be selectively employed, searching for a string in text can be performed with various matching conditions. </para> <para> <orderedlist> <listitem> <para> <emphasis> Primary Level</emphasis>: Typically, this is used to denote differences between base characters (for example, "a" < "b"). It is the strongest difference. For example, dictionaries are divided into different sections by base character. This is also called the level1 strength. </para> </listitem> <listitem> <para> <emphasis> Secondary Level</emphasis>: Accents in the characters are considered secondary differences (for example, "as" < "à s" < "at"). Other differences between letters can also be considered secondary differences, depending on the language. A secondary difference is ignored when there is a primary difference anywhere in the strings. This is also called the level2 strength. <note> <para> Note: In some languages (such as Danish), certain accented letters are considered to be separate base characters. In most languages, however, an accented letter only has a secondary difference from the unaccented version of that letter. </para> </note> </para> </listitem> <listitem> <para> <emphasis> Tertiary Level</emphasis>: Upper and lower case differences in characters are distinguished at the tertiary level (for example, "ao" < "Ao" < "aò"). In addition, a variant of a letter differs from the base form on the tertiary level (such as "A" and " "). Another example is the difference between large and small Kana. A tertiary difference is ignored when there is a primary or secondary difference anywhere in the strings. This is also called the level3 strength. </para> </listitem> <listitem> <para> <emphasis> Quaternary Level</emphasis>: When punctuation is ignored (see Ignoring Punctuations ) at level 13, an additional level can be used to distinguish words with and without punctuation (for example, "ab" < "a-b" < "aB"). This difference is ignored when there is a primary, secondary or tertiary difference. This is also known as the level4 strength. The quaternary level should only be used if ignoring punctuation is required or when processing Japanese text (see Hiragana processing). </para> </listitem> <listitem> <para> <emphasis> Identical Level</emphasis>: When all other levels are equal, the identical level is used as a tiebreaker. The Unicode code point values of the NFD form of each string are compared at this level, just in case there is no difference at levels 14. For example, Hebrew cantillation marks are only distinguished at this level. This level should be used sparingly, as only code point values differences between two strings is an extremely rare occurrence. Using this level substantially decreases the performance for both incremental comparison and sort key generation (as well as increasing the sort key length). It is also known as level 5 strength. </para> </listitem> </orderedlist> </para> <para> For example, people may choose to ignore accents or ignore accents and case when searching for text. Almost all characters are distinguished by the first three levels, and in most locales the default value is thus Tertiary. However, if Alternate is set to be Shifted, then the Quaternary strength can be used to break ties among whitespace, punctuation, and symbols that would otherwise be ignored. If very fine distinctions among characters are required, then the Identical strength can be used (for example, Identical Strength distinguishes between the Mathematical Bold Small A and the Mathematical Italic Small A.). However, using levels higher than Tertiary the Identical strength result in significantly longer sort keys, and slower string comparison performance for equal strings. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>strength</parameter></term> <listitem> <para>Strength to set.</para> <para> Possible values are: <itemizedlist> <listitem> <para> <constant>Collator::PRIMARY</constant> </para> </listitem> <listitem> <para> <constant>Collator::SECONDARY</constant> </para> </listitem> <listitem> <para> <constant>Collator::TERTIARY</constant> </para> </listitem> <listitem> <para> <constant>Collator::QUATERNARY</constant> </para> </listitem> <listitem> <para> <constant>Collator::IDENTICAL</constant> </para> </listitem> <listitem> <para> <constant>Collator::DEFAULT</constant> </para> </listitem> </itemizedlist> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_set_strength</function> example</title> <programlisting role="php"> <![CDATA[ <?php $arr = array( 'aò', 'Ao', 'ao' ); $coll = collator_create( 'en_US' ); // Sort array using default strength. collator_sort( $coll, $arr ); var_export( $arr ); // Sort array using primary strength. collator_set_strength( $coll, Collator::PRIMARY ); collator_sort( $coll, $arr ); var_export( $arr ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ array ( 0 => 'ao', 1 => 'Ao', 2 => 'aò', ) array ( 0 => 'aò', 1 => 'Ao', 2 => 'ao', ) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname> constants</link></member> <member><function>collator_get_strength</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/sort-with-sort-keys.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/sort-with-sort-keys.xml +++ phpdoc/en/reference/intl/collator/sort-with-sort-keys.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.sortwithsortkeys" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::sortWithSortKeys</refname> <refname>collator_sort_with_sort_keys</refname> <refpurpose>Sort array using specified collator and sort keys</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>bool</type> <methodname>Collator::sortWithSortKeys</methodname> <methodparam><type>array</type><parameter>arr</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>collator_sort_with_sort_keys</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>array</type><parameter>arr</parameter></methodparam> </methodsynopsis> <para> Similar to <function>collator_sort</function> but uses ICU sorting keys produced by ucol_getSortKey() to gain more speed on large arrays. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>arr</parameter></term> <listitem> <para>Array of strings to sort</para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_sort_with_sort_keys</function> example</title> <programlisting role="php"> <![CDATA[ <?php $arr = array( 'Köpfe', 'Kypper', 'Kopfe' ); $coll = collator_create( 'sv' ); collator_sort_with_sort_keys( $coll, $arr ); var_export( $arr ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ array ( 0 => 'Kopfe', 1 => 'Kypper', 2 => 'Köpfe', ) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname> constants</link></member> <member><function>collator_sort</function></member> <member><function>collator_asort</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/collator/sort.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/collator/sort.xml +++ phpdoc/en/reference/intl/collator/sort.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="collator.sort" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::sort</refname> <refname>collator_sort</refname> <refpurpose>Sort array using specified collator</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <methodsynopsis> <type>bool</type> <methodname>Collator::sort</methodname> <methodparam><type>array</type><parameter>arr</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>sort_flag</parameter></methodparam> </methodsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>collator_sort</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>array</type><parameter>arr</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>sort_flag</parameter></methodparam> </methodsynopsis> <para>This function sorts an array according to current locale rules.</para> <para> Equivalent to standard PHP <function>sort</function> . </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>arr</parameter></term> <listitem> <para> Array of strings to sort. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>sort_flag</parameter></term> <listitem> <para> Optional sorting type, one of the following: </para> <para> <itemizedlist> <listitem> <para> <constant>Collator::SORT_REGULAR</constant> - compare items normally (don't change types) </para> </listitem> <listitem> <para> <constant>Collator::SORT_NUMERIC</constant> - compare items numerically </para> </listitem> <listitem> <para> <constant>Collator::SORT_STRING</constant> - compare items as strings </para> </listitem> </itemizedlist> Default sorting type is <constant>Collator::SORT_REGULAR</constant>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_sort</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US' ); $arr = array( 'at', 'à s', 'as' ); var_export( $arr ); collator_sort( $coll, $arr ); var_export( $arr ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ array ( 0 => 'at', 1 => 'à s', 2 => 'as', )array ( 0 => 'as', 1 => 'à s', 2 => 'at', ) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><link linkend="intl.collator-constants"><classname>Collator</classname> constants</link></member> <member><function>collator_asort</function></member> <member><function>collator_sort_with_sort_keys</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/compose-locale.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/compose-locale.xml +++ phpdoc/en/reference/intl/locale/compose-locale.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="locale.composelocale" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>Locale::composeLocale</refname> <refname>locale_compose_locale</refname> <refpurpose>Returns a correctly ordered and delimited locale ID</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>composeLocale</methodname> <methodparam><type>array</type><parameter>subtags</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_compose_locale</methodname> <methodparam><type>array</type><parameter>subtags</parameter></methodparam> </methodsynopsis> <para> Returns a correctly ordered and delimited locale ID the keys identify the particular locale ID subtags, and the values are the associated subtag values. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>subtags</parameter></term> <listitem> <para> an array containing a list of key-value pairs, where the keys identify the particular locale ID subtags, and the values are the associated subtag values. <note> <para> The 'variant' and 'private' subtags can take maximum 15 values whereas 'extlang' can take maximum 3 values.e.g. Variants are allowed with the suffix ranging from 0-14 Hence the keys for the input array can be variant0, variant1, ...,variant14 .In the returned locale id, the subtag is ordered by suffix resulting in variant0 followed by variant1 followed by variant2 and so on. </para> </note> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The corresponding locale identifier. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_compose_locale</function> example</title> <programlisting role="php"> <![CDATA[ <?php $arr = array( 'language'=>'en' , 'script' =>'Hans' , 'region' =>'CN', 'variant2'=>'rozaj' , 'variant1'=>'nedis' , 'private1'=>'prv1' , 'private2'=>'prv2' ); echo locale_compose( $arr ); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $arr = array( 'language'=>'en' , 'script' =>'Hans' , 'region' =>'CN', 'variant2'=>'rozaj' , 'variant1'=>'nedis' , 'private1'=>'prv1' , 'private2'=>'prv2' ); echo Locale::composeLocale( $arr ); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Locale: en_Hans_CN_nedis_rozaj_x_prv1_prv2 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_parse</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/filter-matches.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/filter-matches.xml +++ phpdoc/en/reference/intl/locale/filter-matches.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.filtermatches"> <refnamediv> <refname>Locale::filterMatches</refname> <refname>locale_filter_matches</refname> <refpurpose>Checks if a $langtag filter matches with $locale according to</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>boolean</type> <methodname>filterMatches</methodname> <methodparam><type>string</type><parameter>langtag</parameter></methodparam> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>boolean</type> <methodname>locale_filter_matches</methodname> <methodparam><type>string</type><parameter>langtag</parameter></methodparam> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Checks if a $langtag filter matches with $locale according to RFC 4647's basic filtering algorithm </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>langtag</parameter></term> <listitem> <para> The language tag to check </para> </listitem> </varlistentry> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The language range to check against </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &true; if $locale matches $langtag &false; otherwise. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_filter_matches</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo (locale_filter_matches('de-DEVA','de-DE', false)) ? "Matches" : "Does not match"; echo '; '; echo (locale_filter_matches('de-DE_1996','de-DE', false)) ? "Matches" : "Does not match"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo (Locale::filter_matches('de-DEVA','de-DE', false)) ? "Matches" : "Does not match"; echo '; '; echo (Locale::filter_matches('de-DE-1996','de-DE', false)) ? "Matches" : "Does not match"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Does not match; Matches ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_lookup</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-all-variants.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-all-variants.xml +++ phpdoc/en/reference/intl/locale/get-all-variants.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getallvariants"> <refnamediv> <refname>Locale::getAllVariants</refname> <refname>locale_get_all_variants</refname> <refpurpose>Gets the variants for the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>array</type> <methodname>getAllVariants</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>array</type> <methodname>locale_get_all_variants</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Gets the variants for the input locale </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to extract the variants from </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The <type>array</type> containing the list of all variants subtag for the locale or &null; if not present </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_all_variants</function> example</title> <programlisting role="php"> <![CDATA[ <?php $arr = locale_get_all_variants('sl_IT_NEDIS_ROJAZ_1901'); var_export( $arr ); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $arr = Locale::getAllVariants('sl_IT_NEDIS_ROJAZ_1901'); var_export( $arr ); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ array ( 0 => 'NEDIS', 1 => 'ROJAZ', 2 => '1901', ) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_primary_language</function></member> <member><function>locale_get_script</function></member> <member><function>locale_get_region</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-default.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-default.xml +++ phpdoc/en/reference/intl/locale/get-default.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getdefault"> <refnamediv> <refname>Locale::getDefault</refname> <refname>locale_get_default</refname> <refpurpose>Gets the default locale value from the INTL global 'default_locale'</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getDefault</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_default</methodname> <void /> </methodsynopsis> <para> Gets the default locale value. At the PHP initialization this value is set to 'intl.default_locale' value from &php.ini; if that value exists or from ICU's function uloc_getDefault(). </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The current runtime locale </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_default</function> example</title> <programlisting role="php"> <![CDATA[ <?php ini_set('intl.default_locale', 'de-DE'); echo locale_get_default(); echo '; '; locale_set_default('fr'); echo locale_get_default(); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php ini_set('intl.default_locale', 'de-DE'); echo Locale::getDefault(); echo '; '; Locale::setDefault('fr'); echo Locale::getDefault(); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ de-DE; fr ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_set_default</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-display-language.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-display-language.xml +++ phpdoc/en/reference/intl/locale/get-display-language.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getdisplaylanguage"> <refnamediv> <refname>Locale::getDisplayLanguage</refname> <refname>locale_get_display_language</refname> <refpurpose>Returns an appropriately localized display name for language of the inputlocale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getDisplayLanguage</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_display_language</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> <para> Returns an appropriately localized display name for language of the input locale. If is &null; then the default locale is used. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to return a display language for </para> </listitem> </varlistentry> <varlistentry> <term><parameter>in_locale</parameter></term> <listitem> <para> Optional format locale to use to display the language name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> display name of the language for the $locale in the format appropriate for $in_locale. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_display_language</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_display_language('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo locale_get_display_language('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo locale_get_display_language('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Slovenian; slov\xc3\xa8ne; Slowenisch ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_display_name</function></member> <member><function>locale_get_display_script</function></member> <member><function>locale_get_display_region</function></member> <member><function>locale_get_display_variant</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-display-name.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-display-name.xml +++ phpdoc/en/reference/intl/locale/get-display-name.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getdisplayname"> <refnamediv> <refname>Locale::getDisplayName</refname> <refname>locale_get_display_name</refname> <refpurpose>Returns an appropriately localized display name for the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getDisplayName</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_display_name</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> <para> Returns an appropriately localized display name for the input locale. If is &null; then the default locale is used. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to return a display name for. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>in_locale</parameter></term> <listitem> <para>optional format locale</para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Display name of the locale in the format appropriate for $in_locale. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_display_name</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_display_name('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo locale_get_display_name('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo locale_get_display_name('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getDisplayName('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo Locale::getDisplayName('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo Locale::getDisplayName('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Slovenian (Latin, Italy, Natisone dialect); slov\xc3\xa8ne (latin, Italie, dialecte de Natisone; Slowenisch (Lateinisch, Italien, NEDIS) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_display_language</function></member> <member><function>locale_get_display_script</function></member> <member><function>locale_get_display_region</function></member> <member><function>locale_get_display_variant</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-display-region.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-display-region.xml +++ phpdoc/en/reference/intl/locale/get-display-region.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getdisplayregion"> <refnamediv> <refname>Locale::getDisplayRegion</refname> <refname>locale_get_display_region</refname> <refpurpose>Returns an appropriately localized display name for region of the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getDisplayRegion</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_display_region</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> <para> Returns an appropriately localized display name for region of the input locale. If is &null; then the default locale is used. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to return a display region for. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>in_locale</parameter></term> <listitem> <para> Optional format locale to use to display the region name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> display name of the region for the $locale in the format appropriate for $in_locale. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_display_region</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_display_region('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo locale_get_display_region('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo locale_get_display_region('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getDisplayRegion('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo Locale::getDisplayRegion('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo Locale::getDisplayRegion('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Italy; Italie; Italien ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_display_name</function></member> <member><function>locale_get_display_language</function></member> <member><function>locale_get_display_script</function></member> <member><function>locale_get_display_variant</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-display-script.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-display-script.xml +++ phpdoc/en/reference/intl/locale/get-display-script.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getdisplayscript"> <refnamediv> <refname>Locale::getDisplayScript</refname> <refname>locale_get_display_script</refname> <refpurpose>Returns an appropriately localized display name for script of the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getDisplayScript</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_display_script</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> <para> Returns an appropriately localized display name for script of the input locale. If is &null; then the default locale is used. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to return a display script for </para> </listitem> </varlistentry> <varlistentry> <term><parameter>in_locale</parameter></term> <listitem> <para> Optional format locale to use to display the script name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Display name of the script for the $locale in the format appropriate for $in_locale. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_display_script</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_display_script('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo locale_get_display_script('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo locale_get_display_script('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getDisplayScript('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo Locale::getDisplayScript('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo Locale::getDisplayScript('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Latin; latin; Lateinisch ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_display_name</function></member> <member><function>locale_get_display_language</function></member> <member><function>locale_get_display_region</function></member> <member><function>locale_get_display_variant</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-display-variant.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-display-variant.xml +++ phpdoc/en/reference/intl/locale/get-display-variant.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getdisplayvariant"> <refnamediv> <refname>Locale::getDisplayVariant</refname> <refname>locale_get_display_variant</refname> <refpurpose>Returns an appropriately localized display name for variants of the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getDisplayVariant</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_display_variant</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>in_locale</parameter></methodparam> </methodsynopsis> <para> Returns an appropriately localized display name for variants of the input locale. If is &null; then the default locale is used. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to return a display variant for </para> </listitem> </varlistentry> <varlistentry> <term><parameter>in_locale</parameter></term> <listitem> <para> Optional format locale to use to display the variant name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Display name of the variant for the $locale in the format appropriate for $in_locale. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_display_variant</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_display_variant('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo locale_get_display_variant('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo locale_get_display_variant('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getDisplayVariant('sl-Latn-IT-nedis', 'en'); echo ";\n"; echo Locale::getDisplayVariant('sl-Latn-IT-nedis', 'fr'); echo ";\n"; echo Locale::getDisplayVariant('sl-Latn-IT-nedis', 'de'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Natisone dialect; dialecte de Natisone; NEDIS ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_display_name</function></member> <member><function>locale_get_display_language</function></member> <member><function>locale_get_display_script</function></member> <member><function>locale_get_display_region</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-keywords.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-keywords.xml +++ phpdoc/en/reference/intl/locale/get-keywords.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getkeywords"> <refnamediv> <refname>Locale::getKeywords</refname> <refname>locale_get_keywords</refname> <refpurpose>Gets the keywords for the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>array</type> <methodname>getKeywords</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>array</type> <methodname>locale_get_keywords</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Gets the keywords for the input locale. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to extract the keywords from </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Associative <type>array</type> containing the keyword-value pairs for this locale </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_keywords</function> example</title> <programlisting role="php"> <![CDATA[ <?php $keywords_arr = locale_get_keywords( 'de_DE@currency=EUR;collation=PHONEBOOK' ); if ($keywords_arr) { foreach ($keywords_arr as $key => $value) { echo "$key = $value\n"; } } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $keywords_arr = Locale::getKeywords( 'de_DE@currency=EUR;collation=PHONEBOOK' ); if ($keywords_arr) { foreach( $keywords_arr as $key => $value){ echo "$key = $value\n"; } } ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ collation = PHONEBOOK currency = EUR ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_all_variants</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-primary-language.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-primary-language.xml +++ phpdoc/en/reference/intl/locale/get-primary-language.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getprimarylanguage"> <refnamediv> <refname>Locale::getPrimaryLanguage</refname> <refname>locale_get_primary_language</refname> <refpurpose>Gets the primary language for the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getPrimaryLanguage</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_primary_language</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Gets the primary language for the input locale </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to extract the primary language code from </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The language code associated with the language or &null; in case of error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_primary_language</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_primary_language('zh-Hant'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getPrimaryLanguage('zh-Hant'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ zh ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_script</function></member> <member><function>locale_get_region</function></member> <member><function>locale_get_all_variants</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-region.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-region.xml +++ phpdoc/en/reference/intl/locale/get-region.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getregion"> <refnamediv> <refname>Locale::getRegion</refname> <refname>locale_get_region</refname> <refpurpose>Gets the region for the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getRegion</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_region</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Gets the region for the input locale. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to extract the region code from </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The region subtag for the locale or &null; if not present </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_region</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_region('de-CH-1901'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getRegion('de-CH-1901'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ CH ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_primary_language</function></member> <member><function>locale_get_script</function></member> <member><function>locale_get_all_variants</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/get-script.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/get-script.xml +++ phpdoc/en/reference/intl/locale/get-script.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.getscript"> <refnamediv> <refname>Locale::getScript</refname> <refname>locale_get_script</refname> <refpurpose>Gets the script for the input locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>getScript</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_get_script</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Gets the script for the input locale. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to extract the script code from </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The script subtag for the locale or &null; if not present </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_get_script</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo locale_get_script('sr-Cyrl'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo Locale::getScript('sr-Cyrl'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Cyrl ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_primary_language</function></member> <member><function>locale_get_region</function></member> <member><function>locale_get_all_variants</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/lookup.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/lookup.xml +++ phpdoc/en/reference/intl/locale/lookup.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.lookup"> <refnamediv> <refname>Locale::lookup</refname> <refname>locale_lookup</refname> <refpurpose>Searches the language tag list for the best match to the language</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>lookup</methodname> <methodparam><type>array</type><parameter>langtag</parameter></methodparam> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>default</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>locale_lookup</methodname> <methodparam><type>array</type><parameter>langtag</parameter></methodparam> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>default</parameter></methodparam> </methodsynopsis> <para> Searches the items in <parameter>langtag</parameter> for the best match to the language range specified in <parameter>locale</parameter> according to RFC 4647's lookup algorithm. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>langtag</parameter></term> <listitem> <para> An <type>array</type> containing a list of language tags to compare to <parameter>locale</parameter>. Maximum 100 items allowed. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to use as the language range when matching. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>default</parameter></term> <listitem> <para> The locale to use if no match is found. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The closest matching language tag or default value. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_lookup</function> example</title> <programlisting role="php"> <![CDATA[ <?php $arr = array( 'de-DEVA', 'de-DE-1996', 'de', 'de-De' ); echo locale_lookup($arr, 'de-DE-1996-x-prv1-prv2', 'en_US'); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $arr = array( 'de-DEVA', 'de-DE-1996', 'de', 'de-De' ); echo Locale::lookup($arr, 'de-DE-1996-x-prv1-prv2', 'en_US'); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ de_de_1996 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_filter_matches</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/parse-locale.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/parse-locale.xml +++ phpdoc/en/reference/intl/locale/parse-locale.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.parselocale"> <refnamediv> <refname>Locale::parseLocale</refname> <refname>locale_parse_locale</refname> <refpurpose>Returns a key-value array of locale ID subtag elements.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>array</type> <methodname>parseLocale</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>array</type> <methodname>locale_parse_locale</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Returns a key-value array of locale ID subtag elements. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to extract the subtag array from. Note: The 'variant' and 'private' subtags can take maximum 15 values whereas 'extlang' can take maximum 3 values. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an array containing a list of key-value pairs, where the keys identify the particular locale ID subtags, and the values are the associated subtag values. The array will be ordered as the locale id subtags e.g. in the locale id if variants are '-varX-varY-varZ' then the returned array will have variant0=>varX , variant1=>varY , variant2=>varZ </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_parse_locale</function> example</title> <programlisting role="php"> <![CDATA[ <?php $arr = locale_parse('sl-Latn-IT-nedis'); if ($arr) { foreach ($arr as $key => $value) { echo "$key : $value , "; } } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $arr = Locale::parseLocale('sl-Latn-IT-nedis'); if ($arr) { foreach ($arr as $key => $value) { echo "$key : $value , "; } } ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ language : sl , script : Latn , region : IT , variant0 : NEDIS , ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>compose_locale</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/locale/set-default.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/locale/set-default.xml +++ phpdoc/en/reference/intl/locale/set-default.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="locale.setdefault"> <refnamediv> <refname>Locale::setDefault</refname> <refname>locale_set_default</refname> <refpurpose>sets the default runtime locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Locale</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>boolean</type> <methodname>setDefault</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>boolean</type> <methodname>locale_set_default</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> Sets the default runtime locale to $locale. This changes the value of INTL global 'default_locale' locale identifier. UAX #35 extensions are accepted. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> Is a BCP 47 compliant language tag containing the </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>locale_set_default</function> example</title> <programlisting role="php"> <![CDATA[ <?php locale_set_default('de-DE'); echo locale_get_default(); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php Locale::setDefault('de-DE'); echo Locale::getDefault(); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ de-DE ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>locale_get_default</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/create.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/create.xml +++ phpdoc/en/reference/intl/messageformatter/create.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.create"> <refnamediv> <refname>MessageFormatter::create</refname> <refname>MessageFormatter::__construct</refname> <refname>msgfmt_create</refname> <refpurpose>Constructs a new Message Formatter</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style (method) </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>MessageFormatter</type> <methodname>create</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Object oriented style (constructor): </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <constructorsynopsis> <methodname>__construct</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </constructorsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>MessageFormatter</type> <methodname>msgfmt_create</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> <para> Constructs a new Message Formatter </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to use when formatting arguments </para> </listitem> </varlistentry> <varlistentry> <term><parameter>pattern</parameter></term> <listitem> <para> The pattern string to stick arguments into </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The formatter <type>object</type> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_create</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); echo msgfmt_format($fmt, array(4560, 123, 4560/123)); $fmt = msgfmt_create("de", "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum"); echo msgfmt_format($fmt, array(4560, 123, 4560/123)); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); echo $fmt->format(array(4560, 123, 4560/123)); $fmt = new MessageFormatter("de", "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum"); echo $fmt->format(array(4560, 123, 4560/123)); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 4,560 monkeys on 123 trees make 37.073 monkeys per tree 4.560 Affen über 123 Bäume um 37,073 Affen pro Baum ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_format</function></member> <member><function>msgfmt_parse</function></member> <member><function>msgfmt_get_error_code</function></member> <member><function>msgfmt_get_error_message</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/format-message.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/format-message.xml +++ phpdoc/en/reference/intl/messageformatter/format-message.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.formatmessage"> <refnamediv> <refname>MessageFormatter::formatMessage</refname> <refname>msgfmt_format_message</refname> <refpurpose>Quick format message</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>formatMessage</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> <methodparam><type>array</type><parameter>args</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>msgfmt_format_message</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> <methodparam><type>array</type><parameter>args</parameter></methodparam> </methodsynopsis> <para> Quick formatting function that formats the string without having to explicitly create the formatter object. Use this function when the format operation is done only once and does not need and parameters or state to be kept. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to use for formatting locale-dependent parts </para> </listitem> </varlistentry> <varlistentry> <term><parameter>pattern</parameter></term> <listitem> <para> The pattern <type>string</type> to insert things into </para> </listitem> </varlistentry> <varlistentry> <term><parameter>args</parameter></term> <listitem> <para> The <type>array</type> of values to insert into the format <type>string</type> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The formatted pattern string or &false; if an error occurred </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_format_message</function> example</title> <programlisting role="php"> <![CDATA[ <?php echo msgfmt_format_message("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree", array(4560, 123, 4560/123)); echo msgfmt_format_message("de", "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum", array(4560, 123, 4560/123)); ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php echo msgfmt_format_message("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree", array(4560, 123, 4560/123)); echo msgfmt_format_message("de", "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum", array(4560, 123, 4560/123)); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 4,560 monkeys on 123 trees make 37.073 monkeys per tree 4.560 Affen über 123 Bäume um 37,073 Affen pro Baum ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</function></member> <member><function>msgfmt_parse</function></member> <member><function>msgfmt_get_error_code</function></member> <member><function>msgfmt_get_error_message</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/format.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/format.xml +++ phpdoc/en/reference/intl/messageformatter/format.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.format"> <refnamediv> <refname>MessageFormatter::format</refname> <refname>msgfmt_format</refname> <refpurpose>Format the message</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>format</methodname> <methodparam><type>array</type><parameter>args</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>msgfmt_format</methodname> <methodparam><type>MessageFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>array</type><parameter>args</parameter></methodparam> </methodsynopsis> <para> Format the message by substituting the data into the format string according to the locale rules </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> The message formatter </para> </listitem> </varlistentry> <varlistentry> <term><parameter>args</parameter></term> <listitem> <para> Arguments to insert into the format string </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The formatted string, or &false; if an error occurred </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_format</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); echo msgfmt_format($fmt, array(4560, 123, 4560/123)); $fmt = msgfmt_create("de", "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum"); echo msgfmt_format($fmt, array(4560, 123, 4560/123)); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); echo $fmt->format(array(4560, 123, 4560/123)); $fmt = new MessageFormatter("de", "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum"); echo $fmt->format(array(4560, 123, 4560/123)); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 4,560 monkeys on 123 trees make 37.073 monkeys per tree 4.560 Affen über 123 Bäume um 37,073 Affen pro Baum ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</function></member> <member><function>msgfmt_parse</function></member> <member><function>msgfmt_format_message</function></member> <member><function>msgfmt_get_error_code</function></member> <member><function>msgfmt_get_error_message</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/get-error-code.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/get-error-code.xml +++ phpdoc/en/reference/intl/messageformatter/get-error-code.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.geterrorcode"> <refnamediv> <refname>MessageFormatter::getErrorCode</refname> <refname>msgfmt_get_error_code</refname> <refpurpose>Get the error code from last operation</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>integer</type> <methodname>getErrorCode</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>msgfmt_get_error_code</methodname> <methodparam><type>MessageFormatter</type><parameter>fmt</parameter></methodparam> </methodsynopsis> <para> Get the error code from last operation. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> The message formatter </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The error code, one of UErrorCode values. Initial value is U_ZERO_ERROR. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_get_error_code</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create("en_US", "{0, number} monkeys on {1, number} trees"); $str = msgfmt_format($fmt, array()); if(!$str) { echo "ERROR: ".msgfmt_get_error_message($fmt) . " (" . msgfmt_get_error_code($fmt) . ")\n"; } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter("en_US", "{0, number} monkeys on {1, number} trees"); $str = $fmt->format(array()); if(!$str) { echo "ERROR: ".$fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n"; } ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ ERROR: msgfmt_format: not enough parameters: U_ILLEGAL_ARGUMENT_ERROR (1) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_get_error_message</function></member> <member><function>intl_get_error_code</function></member> <member><function>intl_is_failure</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/get-error-message.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/get-error-message.xml +++ phpdoc/en/reference/intl/messageformatter/get-error-message.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.geterrormessage"> <refnamediv> <refname>MessageFormatter::getErrorMessage</refname> <refname>msgfmt_get_error_message</refname> <refpurpose>Get the error text from the last operation</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getErrorMessage</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>msgfmt_get_error_message</methodname> <methodparam><type>MessageFormatter</type><parameter>fmt</parameter></methodparam> </methodsynopsis> <para> Get the error text from the last operation. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> The message formatter </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Description of the last error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_get_error_message</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create("en_US", "{0, number} monkeys on {1, number} trees"); $str = msgfmt_format($fmt, array()); if(!$str) { echo "ERROR: ".msgfmt_get_error_message($fmt) . " (" . msgfmt_get_error_code($fmt) . ")\n"; } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter("en_US", "{0, number} monkeys on {1, number} trees"); $str = $fmt->format(array()); if(!$str) { echo "ERROR: ".$fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n"; } ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ ERROR: msgfmt_format: not enough parameters: U_ILLEGAL_ARGUMENT_ERROR (1) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_get_error_code</function></member> <member><function>intl_get_error_code</function></member> <member><function>intl_is_failure</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/get-locale.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/get-locale.xml +++ phpdoc/en/reference/intl/messageformatter/get-locale.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.getlocale"> <refnamediv> <refname>MessageFormatter::getLocale</refname> <refname>msgfmt_get_locale</refname> <refpurpose>Get the locale for which the formatter was created.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getLocale</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>msgfmt_get_locale</methodname> <methodparam><type>NumberFormatter</type><parameter>formatter</parameter></methodparam> </methodsynopsis> <para> Get the locale for which the formatter was created. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>formatter</parameter></term> <listitem> <para> The formatter resource </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The locale name </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_get_locale</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create('en_US', "Number {0,number}"); echo msgfmt_get_locale($fmt); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter('en_US', "Number {0,number}"); echo $fmt->getLocale(); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ en_US ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/get-pattern.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/get-pattern.xml +++ phpdoc/en/reference/intl/messageformatter/get-pattern.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.getpattern"> <refnamediv> <refname>MessageFormatter::getPattern</refname> <refname>msgfmt_get_pattern</refname> <refpurpose>Get the pattern used by the formatter</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getPattern</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>msgfmt_get_pattern</methodname> <methodparam><type>MessageFormatter</type><parameter>fmt</parameter></methodparam> </methodsynopsis> <para> Get the pattern used by the formatter </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> The message formatter </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The pattern <type>string</type> for this message formatter </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_get_pattern</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create( "en_US", "{0, number} monkeys on {1, number} trees" ); echo "Default pattern: '" . msgfmt_get_pattern( $fmt ) . "'\n"; echo "Formatting result: " . msgfmt_format( $fmt, array(123, 456) ) . "\n"; msgfmt_set_pattern( $fmt, "{0, number} trees hosting {1, number} monkeys" ); echo "New pattern: '" . msgfmt_get_pattern( $fmt ) . "'\n"; echo "Formatted number: " . msgfmt_format( $fmt, array(123, 456) ) . "\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter( "en_US", "{0, number} monkeys on {1, number} trees" ); echo "Default pattern: '" . $fmt->getPattern() . "'\n"; echo "Formatting result: " . $fmt->format(array(123, 456)) . "\n"; $fmt->setPattern("{0, number} trees hosting {1, number} monkeys" ); echo "New pattern: '" . $fmt->getPattern() . "'\n"; echo "Formatted number: " . $fmt->format(array(123, 456)) . "\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Default pattern: '{0,number} monkeys on {1,number} trees' Formatting result: 123 monkeys on 456 trees New pattern: '{0,number} trees hosting {1,number} monkeys' Formatted number: 123 trees hosting 456 monkeys ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</function></member> <member><function>msgfmt_set_pattern</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/parse-message.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/parse-message.xml +++ phpdoc/en/reference/intl/messageformatter/parse-message.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.parsemessage"> <refnamediv> <refname>MessageFormatter::parseMessage</refname> <refname>msgfmt_parse_message</refname> <refpurpose>Quick parse input string</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>array</type> <methodname>parseMessage</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>array</type> <methodname>msgfmt_parse_message</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> Parses input string without explicitly creating the formatter object. Use this function when the format operation is done only once and does not need and parameters or state to be kept. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> The locale to use for parsing locale-dependent parts </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> The <type>string</type> to parse for items </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> An <type>array</type> containing items extracted, or &false; on error </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_parse_message</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_parse_message('en_US', "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree", "4,560 monkeys on 123 trees make 37.073 monkeys per tree"); var_export($res); $fmt = msgfmt_parse_message('de', "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum", "4.560 Affen über 123 Bäume um 37,073 Affen pro Baum"); var_export($res); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = MessageFormatter::parseMessage('en_US', "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree", "4,560 monkeys on 123 trees make 37.073 monkeys per tree"); var_export($res); $fmt = MessageFormatter::parseMessage('de', "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum", "4.560 Affen über 123 Bäume um 37,073 Affen pro Baum"); var_export($res); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ array ( 0 => 4560, 1 => 123, 2 => 37.073, ) array ( 0 => 4560, 1 => 123, 2 => 37.073, ) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</function></member> <member><function>msgfmt_format_message</function></member> <member><function>msgfmt_parse</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/parse.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/parse.xml +++ phpdoc/en/reference/intl/messageformatter/parse.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.parse"> <refnamediv> <refname>MessageFormatter::parse</refname> <refname>msgfmt_parse</refname> <refpurpose>Parse input string according to pattern</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>array</type> <methodname>parse</methodname> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>array</type> <methodname>msgfmt_parse</methodname> <methodparam><type>MessageFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> Parses input <type>string</type> and return any extracted items as an <type>array</type>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> The message formatter </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> The <type>string</type> to parse </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> An <type>array</type> containing the items extracted, or &false; on error </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_parse</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create('en_US', "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); $res = msgfmt_parse($fmt, "4,560 monkeys on 123 trees make 37.073 monkeys per tree"); var_export($res); $fmt = msgfmt_create('de', "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum"); $res = msgfmt_parse($fmt, "4.560 Affen über 123 Bäume um 37,073 Affen pro Baum"); var_export($res); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter('en_US', "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); $res = $fmt->parse("4,560 monkeys on 123 trees make 37.073 monkeys per tree"); var_export($res); $fmt = new MessageFormatter('de', "{0,number,integer} Affen über {1,number,integer} Bäume um {2,number} Affen pro Baum"); $res = $fmt->parse("4.560 Affen über 123 Bäume um 37,073 Affen pro Baum"); var_export($res); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ array ( 0 => 4560, 1 => 123, 2 => 37.073, ) array ( 0 => 4560, 1 => 123, 2 => 37.073, ) ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</function></member> <member><function>msgfmt_format</function></member> <member><function>msgfmt_parse_message</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/messageformatter/set-pattern.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/messageformatter/set-pattern.xml +++ phpdoc/en/reference/intl/messageformatter/set-pattern.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="messageformatter.setpattern"> <refnamediv> <refname>MessageFormatter::setPattern</refname> <refname>msgfmt_set_pattern</refname> <refpurpose>Set the pattern used by the formatter</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>MessageFormatter</classname> </ooclass> <methodsynopsis> <type>boolean</type> <methodname>setPattern</methodname> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>boolean</type> <methodname>msgfmt_set_pattern</methodname> <methodparam><type>MessageFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> <para> Set the pattern used by the formatter </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> The message formatter </para> </listitem> </varlistentry> <varlistentry> <term><parameter>pattern</parameter></term> <listitem> <para> The pattern <type>string</type> to use in this message formatter </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>msgfmt_set_pattern</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = msgfmt_create( "en_US", "{0, number} monkeys on {1, number} trees" ); echo "Default pattern: '" . msgfmt_get_pattern( $fmt ) . "'\n"; echo "Formatting result: " . msgfmt_format( $fmt, array(123, 456) ) . "\n"; msgfmt_set_pattern( $fmt, "{0, number} trees hosting {1, number} monkeys" ); echo "New pattern: '" . msgfmt_get_pattern( $fmt ) . "'\n"; echo "Formatted number: " . msgfmt_format( $fmt, array(123, 456) ) . "\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new MessageFormatter( "en_US", "{0, number} monkeys on {1, number} trees" ); echo "Default pattern: '" . $fmt->getPattern() . "'\n"; echo "Formatting result: " . $fmt->format(array(123, 456)) . "\n"; $fmt->setPattern("{0, number} trees hosting {1, number} monkeys" ); echo "New pattern: '" . $fmt->getPattern() . "'\n"; echo "Formatted number: " . $fmt->format(array(123, 456)) . "\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Default pattern: '{0,number} monkeys on {1,number} trees' Formatting result: 123 monkeys on 456 trees New pattern: '{0,number} trees hosting {1,number} monkeys' Formatted number: 123 trees hosting 456 monkeys ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>msgfmt_create</function></member> <member><function>msgfmt_get_pattern</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/normalizer/is-normalized.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/normalizer/is-normalized.xml +++ phpdoc/en/reference/intl/normalizer/is-normalized.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="normalizer.isnormalized"> <refnamediv> <refname>Normalizer::isNormalized</refname> <refname>normalizer_is_normalized</refname> <refpurpose>Checks if the provided string is already in the specified normalization form.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Normalizer</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>boolean</type> <methodname>isNormalized</methodname> <methodparam><type>string</type><parameter>input</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>boolean</type> <methodname>normalizer_is_normalized</methodname> <methodparam><type>string</type><parameter>input</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> </methodsynopsis> <para> Checks if the provided string is already in the specified normalization form. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>input</parameter></term> <listitem> <para> The input string to normalize </para> </listitem> </varlistentry> <varlistentry> <term><parameter>form</parameter></term> <listitem> <para> One of the normalization forms </para> </listitem> </varlistentry> <varlistentry> <term><parameter>options</parameter></term> <listitem> <para> Normalization options </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &true; if normalized, &false; otherwise or if there an error </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>normalizer_is_normalized</function> example</title> <programlisting role="php"> <![CDATA[ <?php $char_A_ring = "\xC3\x85"; // 'LATIN CAPITAL LETTER A WITH RING ABOVE' (U+00C5) $char_combining_ring_above = "\xCC\x8A"; // 'COMBINING RING ABOVE' (U+030A) $char_orig = 'A' . $char_combining_ring_above; $char_norm = normalizer_normalize( 'A' . $char_combining_ring_above, Normalizer::FORM_C ); echo ( normalizer_is_normalized($char_orig, Normalizer::FORM_C) ) ? "normalized" : "not normalized"; echo '; '; echo ( normalizer_is_normalized($char_norm, Normalizer::FORM_C) ) ? "normalized" : "not normalized"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $char_A_ring = "\xC3\x85"; // 'LATIN CAPITAL LETTER A WITH RING ABOVE' (U+00C5) $char_combining_ring_above = "\xCC\x8A"; // 'COMBINING RING ABOVE' (U+030A) $char_orig = 'A' . $char_combining_ring_above; $char_norm = Normalizer::normalize( 'A' . $char_combining_ring_above, Normalizer::FORM_C ); echo ( Normalizer::isNormalized($char_orig, Normalizer::FORM_C) ) ? "normalized" : "not normalized"; echo '; '; echo ( Normalizer::isNormalized($char_norm, Normalizer::FORM_C) ) ? "normalized" : "not normalized"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ not normalized; normalized ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>normalizer_normalize</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/normalizer/normalize.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/normalizer/normalize.xml +++ phpdoc/en/reference/intl/normalizer/normalize.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="normalizer.normalize"> <refnamediv> <refname>Normalizer::normalize</refname> <refname>normalizer_normalize</refname> <refpurpose>Normalizes the input provided and returns the normalized string</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>Normalizer</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>string</type> <methodname>normalize</methodname> <methodparam><type>string</type><parameter>input</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>normalizer_normalize</methodname> <methodparam><type>string</type><parameter>input</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam> </methodsynopsis> <para> Normalizes the input provided and returns the normalized <type>string</type> </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>input</parameter></term> <listitem> <para> The input string to normalize </para> </listitem> </varlistentry> <varlistentry> <term><parameter>form</parameter></term> <listitem> <para> One of the normalization forms </para> </listitem> </varlistentry> <varlistentry> <term><parameter>options</parameter></term> <listitem> <para> Normalization options </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The normalized string or &null; if an error occurred. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>normalizer_normalize</function> example</title> <programlisting role="php"> <![CDATA[ <?php $char_A_ring = "\xC3\x85"; // 'LATIN CAPITAL LETTER A WITH RING ABOVE' (U+00C5) $char_combining_ring_above = "\xCC\x8A"; // 'COMBINING RING ABOVE' (U+030A) $char_1 = normalizer_normalize( $char_A_ring, Normalizer::FORM_C ); $char_2 = normalizer_normalize( 'A' . $char_combining_ring_above, Normalizer::FORM_C ); echo urlencode($char_1); echo ' '; echo urlencode($char_2); ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $char_A_ring = "\xC3\x85"; // 'LATIN CAPITAL LETTER A WITH RING ABOVE' (U+00C5) $char_combining_ring_above = "\xCC\x8A"; // 'COMBINING RING ABOVE' (U+030A) $char_1 = Normalizer::normalize( $char_A_ring, Normalizer::FORM_C ); $char_2 = Normalizer::normalize( 'A' . $char_combining_ring_above, Normalizer::FORM_C ); echo urlencode($char_1); echo ' '; echo urlencode($char_2); ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ %C3%85 %C3%85 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>normalizer_is_normalized</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/create.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/create.xml +++ phpdoc/en/reference/intl/numberformatter/create.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.create" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::create</refname> <refname>numfmt_create</refname> <refname>NumberFormatter::__construct</refname> <refpurpose>Create a number formatter</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style (method) </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <modifier>static</modifier> <type>NumberFormatter</type> <methodname>create</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>integer</type><parameter>style</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>NumberFormatter</type> <methodname>numfmt_create</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>integer</type><parameter>style</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> <para> Object oriented style (constructor): </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <constructorsynopsis> <methodname>__construct</methodname> <methodparam><type>string</type><parameter>locale</parameter></methodparam> <methodparam><type>integer</type><parameter>style</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>pattern</parameter></methodparam> </constructorsynopsis> </classsynopsis> <para> Creates a number formatter. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>locale</parameter></term> <listitem> <para> Locale in which the number would be formatted (locale name, e.g. en_CA). </para> </listitem> </varlistentry> <varlistentry> <term><parameter>style</parameter></term> <listitem> <para> Style of the formatting, one of the <link linkend="intl.numberformatter-constants.UNumberFormatStyle"> format style</link> constants. If <constant>NumberFormatter::PATTERN_DECIMAL</constant> or <constant>NumberFormatter::PATTERN_RULEBASED</constant> is passed then the number format is opened using the given pattern, which must conform to the syntax described in <link xlink:href="&url.icu.decimalformat;">ICU DecimalFormat documentation</link> or <link xlink:href="&url.icu.ruleformat;">ICU RuleBasedNumberFormat documentation</link>, respectively. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>pattern</parameter></term> <listitem> <para> Pattern string in case chosen style requires pattern. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns <classname>NumberFormatter</classname> object or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_create</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo numfmt_format($fmt, 1234567.891234567890000)."\n"; $fmt = numfmt_create( 'it', NumberFormatter::SPELLOUT ); echo numfmt_format($fmt, 1142)."\n"; ?> ]]> </programlisting> </example> <example> <title><function>NumberFormatter</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo $fmt->format(1234567.891234567890000)."\n"; $fmt = new NumberFormatter( 'it', NumberFormatter::SPELLOUT ); echo $fmt->format(1142)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 1.234.567,891 millicentoquarantadue ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_format</function></member> <member><function>numfmt_parse</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/format-currency.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/format-currency.xml +++ phpdoc/en/reference/intl/numberformatter/format-currency.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.formatcurrency" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::formatCurrency</refname> <refname>numfmt_format_currency</refname> <refpurpose>Format a currency value</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>formatCurrency</methodname> <methodparam><type>double</type><parameter>value</parameter></methodparam> <methodparam><type>string</type><parameter>currency</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_format_currency</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>double</type><parameter>value</parameter></methodparam> <methodparam><type>string</type><parameter>currency</parameter></methodparam> </methodsynopsis> <para> Format the currency value according to the formatter rules. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> The numeric currency value. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>currency</parameter></term> <listitem> <para> The 3-letter ISO 4217 currency code indicating the currency to use. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> String representing the formatted currency value. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_format_currency</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::CURRENCY ); echo numfmt_format_currency($fmt, 1234567.891234567890000, "EUR")."\n"; echo numfmt_format_currency($fmt, 1234567.891234567890000, "RUR")."\n"; $fmt = numfmt_create( 'ru_RU', NumberFormatter::CURRENCY ); echo numfmt_format_currency($fmt, 1234567.891234567890000, "EUR")."\n"; echo numfmt_format_currency($fmt, 1234567.891234567890000, "RUR")."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::CURRENCY ); echo $fmt->formatCurrency(1234567.891234567890000, "EUR")."\n"; echo $fmt->formatCurrency(1234567.891234567890000, "RUR")."\n"; $fmt = new NumberFormatter( 'ru_RU', NumberFormatter::CURRENCY ); echo $fmt->formatCurrency(1234567.891234567890000, "EUR")."\n"; echo $fmt->formatCurrency(1234567.891234567890000, "RUR")."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 1.234.567,89 ⬠1.234.567,89 RUR 1 234 567,89⬠1 234 567,89Ñ. ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_format</function></member> <member><function>numfmt_parse_currency</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/format.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/format.xml +++ phpdoc/en/reference/intl/numberformatter/format.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.format" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::format</refname> <refname>numfmt_format</refname> <refpurpose>Format a number</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>format</methodname> <methodparam><type>integer|double</type><parameter>value</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_format</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer|double</type><parameter>value</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> </methodsynopsis> <para> Format a numeric value according to the formatter rules. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> The value to format. Can be <type>integer</type> or <type>double</type>, other values will be converted to a numeric value. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>type</parameter></term> <listitem> <para> The <link linkend="intl.numberformatter-constants.types"> formatting type</link> to use. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the string containing formatted value, or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_format</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); $data = numfmt_format($fmt, 1234567.891234567890000); if(intl_is_failure(numfmt_format($fmt))) { report_error("Formatter error"); } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); $fmt->format(1234567.891234567890000); if(intl_is_failure($fmt->getErrorCode()) { report_error("Formatter error"); } ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 1.234.567,891 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_format_currency</function></member> <member><function>numfmt_parse</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-attribute.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-attribute.xml +++ phpdoc/en/reference/intl/numberformatter/get-attribute.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.getattribute" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getAttribute</refname> <refname>numfmt_get_attribute</refname> <refpurpose>Get an attribute</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>integer</type> <methodname>getAttribute</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>numfmt_get_attribute</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> <para> Get a numeric attribute associated with the formatter. An example of a numeric attribute is the number of integer digits the formatter will produce. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Attribute specifier - one of the <link linkend="intl.numberformatter-constants.UNumberFormatAttribute"> numeric attribute</link> constants. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Return attribute value on success, or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_attribute</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Digits: ".numfmt_get_attribute($fmt, NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; numfmt_set_attribute($fmt, NumberFormatter::MAX_FRACTION_DIGITS, 2); echo "Digits: ".numfmt_get_attribute($fmt, NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Digits: ".$fmt->getAttribute(NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; $fmt->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, 2); echo "Digits: ".$fmt->getAttribute(NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Digits: 3 1.234.567,891 Digits: 2 1.234.567,89 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_get_text_attribute</function></member> <member><function>numfmt_set_attribute</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-error-code.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-error-code.xml +++ phpdoc/en/reference/intl/numberformatter/get-error-code.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.geterrorcode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getErrorCode</refname> <refname>numfmt_get_error_code</refname> <refpurpose>Get formatter's last error code.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>integer</type> <methodname>getErrorCode</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>integer</type> <methodname>numfmt_get_error_code</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> </methodsynopsis> <para> Get error code from the last function performed by the formatter. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns error code from last formatter call. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_error_code</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); $data = numfmt_format($fmt, 1234567.891234567890000); if(intl_is_failure(numfmt_get_error_code($fmt))) { report_error("Formatter error"); } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); $fmt->format(1234567.891234567890000); if(intl_is_failure($fmt->getErrorCode()) { report_error("Formatter error"); } ?> ]]> </programlisting> </example> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_message</function></member> <member><function>intl_get_error_code</function></member> <member><function>intl_is_failure</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-error-message.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-error-message.xml +++ phpdoc/en/reference/intl/numberformatter/get-error-message.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.geterrormessage" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getErrorMessage</refname> <refname>numfmt_get_error_message</refname> <refpurpose>Get formatter's last error message.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getErrorMessage</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_get_error_message</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> </methodsynopsis> <para> Get error message from the last function performed by the formatter. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns error message from last formatter call. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_error_message</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); $data = numfmt_format($fmt, 1234567.891234567890000); if(intl_is_failure(numfmt_get_error_code($fmt))) { report_error("Formatter error"); } ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); $fmt->format(1234567.891234567890000); if(intl_is_failure($fmt->getErrorCode()) { report_error("Formatter error"); } ?> ]]> </programlisting> </example> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_message</function></member> <member><function>intl_get_error_code</function></member> <member><function>intl_is_failure</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-locale.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-locale.xml +++ phpdoc/en/reference/intl/numberformatter/get-locale.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.getlocale" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getLocale</refname> <refname>numfmt_get_locale</refname> <refpurpose>Get formatter locale</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getLocale</methodname> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_get_locale</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> </methodsynopsis> <para> Get formatter locale name. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>type</parameter></term> <listitem> <para> You can choose between valid and actual locale ( <constant>Locale::VALID_LOCALE</constant>, <constant>Locale::ACTUAL_LOCALE</constant>, respectively). The default is the actual locale. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The locale name used to create the formatter. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_locale</function> example</title> <programlisting role="php"> <![CDATA[ <?php $req = 'fr_FR_PARIS'; $fmt = numfmt_create( $req, NumberFormatter::DECIMAL); $res_val = numfmt_get_locale( $fmt, Locale::VALID_LOCALE ); $res_act = numfmt_get_locale( $fmt, Locale::ACTUAL_LOCALE ); printf( "Requested locale name: %s\nValid locale name: %s\nActual locale name: %s\n", $req, $res_val, $res_act ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ Requested locale name: fr_FR_PARIS Valid locale name: fr_FR Actual locale name: fr ]]> </screen> </example> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_create</function></member> <member><function>numfmt_get_error_code</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-pattern.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-pattern.xml +++ phpdoc/en/reference/intl/numberformatter/get-pattern.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.getpattern" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getPattern</refname> <refname>numfmt_get_pattern</refname> <refpurpose>Get formatter pattern</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getPattern</methodname> <void /> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_get_pattern</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> </methodsynopsis> <para> Extract pattern used by the formatter. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Pattern <type>string</type> that is used by the formatter, or &false; if an error happens. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_pattern</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Pattern: ".numfmt_get_pattern($fmt)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; numfmt_set_pattern($fmt, "#0.# kg"); echo "Pattern: ".numfmt_get_pattern($fmt)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Pattern: ".$fmt->getPattern()."\n"; echo $fmt->format(1234567.891234567890000)."\n"; $fmt->setPattern("#0.# kg"); echo "Pattern: ".$fmt->getPattern()."\n"; echo $fmt->format(1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Pattern: #,##0.### 1.234.567,891 Pattern: #0.# kg 1234567,9 kg ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_set_pattern</function></member> <member><function>numfmt_create</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-symbol.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-symbol.xml +++ phpdoc/en/reference/intl/numberformatter/get-symbol.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.getsymbol" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getSymbol</refname> <refname>numfmt_get_symbol</refname> <refpurpose>Get a symbol value</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getSymbol</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_get_symbol</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> <para> Get a symbol associated with the formatter. The formatter uses symbols to represent the special locale-dependent characters in a number, for example the percent sign. This API is not supported for rule-based formatters. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Symbol specifier, one of the <link linkend="intl.numberformatter-constants.UNumberFormatSymbol"> format symbol</link> constants. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The symbol string or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_symbol</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Sep: ".numfmt_get_symbol($fmt, NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; numfmt_set_symbol($fmt, NumberFormatter::GROUPING_SEPARATOR_SYMBOL, "*"); echo "Sep: ".numfmt_get_symbol($fmt, NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Sep: ".$fmt->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; $fmt->setSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL, "*"); echo "Sep: ".$fmt->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Sep: . 1.234.567,891 Sep: * 1*234*567,891 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_set_symbol</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/get-text-attribute.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/get-text-attribute.xml +++ phpdoc/en/reference/intl/numberformatter/get-text-attribute.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.gettextattribute" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::getTextAttribute</refname> <refname>numfmt_get_text_attribute</refname> <refpurpose>Get a text attribute</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>string</type> <methodname>getTextAttribute</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>string</type> <methodname>numfmt_get_text_attribute</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> </methodsynopsis> <para> Get a text attribute associated with the formatter. An example of a text attribute is the suffix for positive numbers. If the formatter does not understand the attributre, <constant>U_UNSUPPORTED_ERROR</constant> error is produced. Rule-based formatters only understand <constant>NumberFormatter::DEFAULT_RULESET</constant> and <constant>NumberFormatter::PUBLIC_RULESETS</constant>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Attribute specifier - one of the <link linkend="intl.numberformatter-constants.UNumberFormatTextAttribute"> text attribute</link> constants. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Return attribute value on success, or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_get_text_attribute</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Prefix: ".numfmt_get_text_attribute($fmt, NumberFormatter::NEGATIVE_PREFIX)."\n"; echo numfmt_format($fmt, -1234567.891234567890000)."\n"; numfmt_set_text_attribute($fmt, NumberFormatter::NEGATIVE_PREFIX, "MINUS"); echo "Prefix: ".numfmt_get_text_attribute($fmt, NumberFormatter::NEGATIVE_PREFIX)."\n"; echo numfmt_format($fmt, -1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Prefix: ".$fmt->getTextAttribute(NumberFormatter::NEGATIVE_PREFIX)."\n"; echo $fmt->format(-1234567.891234567890000)."\n"; $fmt->setTextAttribute(NumberFormatter::NEGATIVE_PREFIX, "MINUS"); echo "Prefix: ".$fmt->getTextAttribute(NumberFormatter::NEGATIVE_PREFIX)."\n"; echo $fmt->format(-1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Prefix: - -1.234.567,891 Prefix: MINUS MINUS1.234.567,891 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_get_attribute</function></member> <member><function>numfmt_set_text_attribute</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/parse-currency.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/parse-currency.xml +++ phpdoc/en/reference/intl/numberformatter/parse-currency.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.parsecurrency" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::parseCurrency</refname> <refname>numfmt_parse_currency</refname> <refpurpose>Parse a currency number</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>double</type> <methodname>parseCurrency</methodname> <methodparam><type>string</type><parameter>value</parameter></methodparam> <methodparam><type>string</type><parameter role="reference">currency</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter role="reference">position</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>double</type> <methodname>numfmt_parse_currency</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> <methodparam><type>string</type><parameter role="reference">currency</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter role="reference">position</parameter></methodparam> </methodsynopsis> <para> Parse a string into a double and a currency using the current formatter. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>position</parameter></term> <listitem> <para> Parameter to receive the currency name (3-letter ISO 4217 currency code). </para> </listitem> </varlistentry> <varlistentry> <term><parameter>position</parameter></term> <listitem> <para> Offset in the string at which to begin parsing. On return, this value will hold the offset at which parsing ended. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The parsed numeric value or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_parse_currency</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::CURRENCY ); $num = "1.234.567,89 $"; echo "We have ".numfmt_parse_currency($fmt, $num, $curr)." in $curr\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::CURRENCY ); $num = "1.234.567,89 $"; echo "We have ".$fmt->parseCurrency($num, $curr)." in $curr\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ We have 1234567.89 in USD ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_parse</function></member> <member><function>numfmt_format_currency</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/parse.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/parse.xml +++ phpdoc/en/reference/intl/numberformatter/parse.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.parse" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::parse</refname> <refname>numfmt_parse</refname> <refpurpose>Parse a number</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>mixed</type> <methodname>parse</methodname> <methodparam><type>string</type><parameter>value</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter role="reference">position</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>mixed</type> <methodname>numfmt_parse</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter>type</parameter></methodparam> <methodparam choice="opt"><type>integer</type><parameter role="reference">position</parameter></methodparam> </methodsynopsis> <para> Parse a string into a number using the current formatter rules. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>type</parameter></term> <listitem> <para> The <link linkend="intl.numberformatter-constants.types"> formatting type</link> to use. By default, <constant>NumberFormatter::TYPE_DOUBLE</constant> is used. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>position</parameter></term> <listitem> <para> Offset in the string at which to begin parsing. On return, this value will hold the offset at which parsing ended. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The value of the parsed number or &false; on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_parse</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); $num = "1.234.567,891"; echo numfmt_parse($fmt, $num)."\n"; echo numfmt_parse($fmt, $num, NumberFormatter::TYPE_INT32)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); $num = "1.234.567,891"; echo $fmt->parse($num)."\n"; echo $fmt->parse($num, NumberFormatter::TYPE_INT32)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ 1234567.891 1234567 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_format</function></member> <member><function>numfmt_parse_currency</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/set-attribute.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/set-attribute.xml +++ phpdoc/en/reference/intl/numberformatter/set-attribute.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.setattribute" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::setAttribute</refname> <refname>numfmt_set_attribute</refname> <refpurpose>Set an attribute</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>bool</type> <methodname>setAttribute</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>integer</type><parameter>value</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>numfmt_set_attribute</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>integer</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> Set a numeric attribute associated with the formatter. An example of a numeric attribute is the number of integer digits the formatter will produce. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Attribute specifier - one of the <link linkend="intl.numberformatter-constants.UNumberFormatAttribute"> numeric attribute</link> constants. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> The attribute value. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_set_attribute</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Digits: ".numfmt_get_attribute($fmt, NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; numfmt_set_attribute($fmt, NumberFormatter::MAX_FRACTION_DIGITS, 2); echo "Digits: ".numfmt_get_attribute($fmt, NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Digits: ".$fmt->getAttribute(NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; $fmt->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, 2); echo "Digits: ".$fmt->getAttribute(NumberFormatter::MAX_FRACTION_DIGITS)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Digits: 3 1.234.567,891 Digits: 2 1.234.567,89 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_get_attribute</function></member> <member><function>numfmt_set_text_attribute</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/set-pattern.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/set-pattern.xml +++ phpdoc/en/reference/intl/numberformatter/set-pattern.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.setpattern" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::setPattern</refname> <refname>numfmt_set_pattern</refname> <refpurpose>Set formatter pattern</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>bool</type> <methodname>setPattern</methodname> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>numfmt_set_pattern</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>string</type><parameter>pattern</parameter></methodparam> </methodsynopsis> <para> Set the pattern used by the formatter. Can not be used on a rule-based formatter. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>pattern</parameter></term> <listitem> <para> Pattern in syntax described in <link xlink:href="&url.icu.decimalformat;">ICU DecimalFormat documentation</link>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_set_pattern</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Pattern: ".numfmt_get_pattern($fmt)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; numfmt_set_pattern($fmt, "#0.# kg"); echo "Pattern: ".numfmt_get_pattern($fmt)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Pattern: ".$fmt->getPattern()."\n"; echo $fmt->format(1234567.891234567890000)."\n"; $fmt->setPattern("#0.# kg"); echo "Pattern: ".$fmt->getPattern()."\n"; echo $fmt->format(1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Pattern: #,##0.### 1.234.567,891 Pattern: #0.# kg 1234567,9 kg ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_create</function></member> <member><function>numfmt_get_pattern</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/set-symbol.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/set-symbol.xml +++ phpdoc/en/reference/intl/numberformatter/set-symbol.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.setsymbol" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::setSymbol</refname> <refname>numfmt_set_symbol</refname> <refpurpose>Set a symbol value</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>bool</type> <methodname>setSymbol</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>numfmt_set_symbol</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> Set a symbol associated with the formatter. The formatter uses symbols to represent the special locale-dependent characters in a number, for example the percent sign. This API is not supported for rule-based formatters. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Symbol specifier, one of the <link linkend="intl.numberformatter-constants.UNumberFormatSymbol"> format symbol</link> constants. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> Text for the symbol. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_set_symbol</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Sep: ".numfmt_get_symbol($fmt, NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; numfmt_set_symbol($fmt, NumberFormatter::GROUPING_SEPARATOR_SYMBOL, "*"); echo "Sep: ".numfmt_get_symbol($fmt, NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo numfmt_format($fmt, 1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Sep: ".$fmt->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; $fmt->setSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL, "*"); echo "Sep: ".$fmt->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL)."\n"; echo $fmt->format(1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Sep: . 1.234.567,891 Sep: * 1*234*567,891 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_get_symbol</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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/intl/numberformatter/set-text-attribute.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/intl/numberformatter/set-text-attribute.xml +++ phpdoc/en/reference/intl/numberformatter/set-text-attribute.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="numberformatter.settextattribute" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>NumberFormatter::setTextAttribute</refname> <refname>numfmt_set_text_attribute</refname> <refpurpose>Set a text attribute</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Object oriented style </para> <classsynopsis> <ooclass> <classname>NumberFormatter</classname> </ooclass> <methodsynopsis> <type>bool</type> <methodname>setTextAttribute</methodname> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Procedural style </para> <methodsynopsis> <type>bool</type> <methodname>numfmt_set_text_attribute</methodname> <methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam> <methodparam><type>integer</type><parameter>attr</parameter></methodparam> <methodparam><type>string</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> Set a text attribute associated with the formatter. An example of a text attribute is the suffix for positive numbers. If the formatter does not understand the attribute, <constant>U_UNSUPPORTED_ERROR</constant> error is produced. Rule-based formatters only understand <constant>NumberFormatter::DEFAULT_RULESET</constant> and <constant>NumberFormatter::PUBLIC_RULESETS</constant>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>fmt</parameter></term> <listitem> <para> <classname>NumberFormatter</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>attr</parameter></term> <listitem> <para> Attribute specifier - one of the <link linkend="intl.numberformatter-constants.UNumberFormatTextAttribute">text attribute</link> constants. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>value</parameter></term> <listitem> <para> Text for the attribute value. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title><function>numfmt_set_text_attribute</function> example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Prefix: ".numfmt_get_text_attribute($fmt, NumberFormatter::NEGATIVE_PREFIX)."\n"; echo numfmt_format($fmt, -1234567.891234567890000)."\n"; numfmt_set_text_attribute($fmt, NumberFormatter::NEGATIVE_PREFIX, "MINUS"); echo "Prefix: ".numfmt_get_text_attribute($fmt, NumberFormatter::NEGATIVE_PREFIX)."\n"; echo numfmt_format($fmt, -1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> <example> <title>OO example</title> <programlisting role="php"> <![CDATA[ <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Prefix: ".$fmt->getTextAttribute(NumberFormatter::NEGATIVE_PREFIX)."\n"; echo $fmt->format(-1234567.891234567890000)."\n"; $fmt->setTextAttribute(NumberFormatter::NEGATIVE_PREFIX, "MINUS"); echo "Prefix: ".$fmt->getTextAttribute(NumberFormatter::NEGATIVE_PREFIX)."\n"; echo $fmt->format(-1234567.891234567890000)."\n"; ?> ]]> </programlisting> </example> &example.outputs; <screen> <![CDATA[ Prefix: - -1.234.567,891 Prefix: MINUS MINUS1.234.567,891 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>numfmt_get_error_code</function></member> <member><function>numfmt_get_text_attribute</function></member> <member><function>numfmt_set_attribute</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:"../../../../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 -->