hholzgra Wed Sep 18 03:56:17 2002 EDT Modified files: /phpdoc/en/reference/strings/functions setlocale.xml Log: documentation for new optional calling convention Index: phpdoc/en/reference/strings/functions/setlocale.xml diff -u phpdoc/en/reference/strings/functions/setlocale.xml:1.3 phpdoc/en/reference/strings/functions/setlocale.xml:1.4 --- phpdoc/en/reference/strings/functions/setlocale.xml:1.3 Sat Jul 27 00:07:06 2002 +++ phpdoc/en/reference/strings/functions/setlocale.xml Wed Sep 18 03:56:17 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> <refentry id="function.setlocale"> <refnamediv> @@ -12,6 +12,12 @@ <type>string</type><methodname>setlocale</methodname> <methodparam><type>mixed</type><parameter>category</parameter></methodparam> <methodparam><type>string</type><parameter>locale</parameter></methodparam> + <methodparam +choice='opt'><type>string</type><parameter>...</parameter></methodparam> + </methodsynopsis> + <methodsynopsis> + <type>string</type><methodname>setlocale</methodname> + <methodparam><type>mixed</type><parameter>category</parameter></methodparam> + <methodparam><type>array</type><parameter>locale</parameter></methodparam> </methodsynopsis> <para> <parameter>Category</parameter> is a named constant (or string) @@ -60,10 +66,18 @@ categories, or from "LANG". </para> <para> - If locale is zero or <literal>"0"</literal>, the locale setting + If <parameter>locale</parameter> is zero or <literal>"0"</literal>, the locale +setting is not affected, only the current setting is returned. </para> <para> + If <parameter>locale</parameter> is an array or followed by additional + parameters then each array element or parameter is tried to be set as + new locale until success. This is usefull if a locale is known under + different names on different systems or for providing a fallback + for a possibly not available locale. + <note><simpara>Passing multiple locales is not available before PHP +4.3</simpara></note> + </para> + <para> Setlocale returns the new current locale, or &false; if the locale functionality is not implemented in the platform, the specified locale does not exist or the category name is invalid. @@ -80,6 +94,10 @@ /* Output: vrijdag 22 december 1978 */ echo strftime ("%A %e %B %Y", mktime (0, 0, 0, 12, 22, 1978)); + + /* try different possible locale names for german */ + $loc_de = setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge'); + echo "Preferred locale for german on this system is '$loc_de'; ?> ]]> </programlisting>
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php