|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | | -<!-- EN-Revision: 45042fef652f1b4e904e809fcbfcf31f6c60670b Maintainer: leonardolara Status: ready --><!-- CREDITS: leonardolara --> |
| 2 | +<!-- EN-Revision: 09324fb1df7b5b1c0a5f95e3ebbe802f59da4585 Maintainer: leonardolara Status: ready --><!-- CREDITS: leonardolara --> |
3 | 3 | <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" xml:id="function.setlocale"> |
4 | 4 | <refnamediv> |
5 | 5 | <refname>setlocale</refname> |
|
11 | 11 | <methodsynopsis> |
12 | 12 | <type class="union"><type>string</type><type>false</type></type><methodname>setlocale</methodname> |
13 | 13 | <methodparam><type>int</type><parameter>category</parameter></methodparam> |
14 | | - <methodparam><type>string</type><parameter>locales</parameter></methodparam> |
| 14 | + <methodparam><type class="union"><type>string</type><type>null</type></type><parameter>locales</parameter></methodparam> |
15 | 15 | <methodparam rep="repeat"><type>string</type><parameter>rest</parameter></methodparam> |
16 | 16 | </methodsynopsis> |
17 | 17 | <simpara>Assinatura alternativa (não suportada com argumentos nomeados):</simpara> |
|
97 | 97 | <listitem> |
98 | 98 | <para> |
99 | 99 | Se <parameter>locales</parameter> for uma string vazia |
100 | | - <literal>""</literal>, os nomes de localidade serão definidos a partir dos |
| 100 | + <literal>""</literal> ou &null;, os nomes de localidade serão definidos a partir dos |
101 | 101 | valores das variáveis de ambiente com os mesmos nomes das categorias |
102 | 102 | acima, ou de "LANG". |
103 | 103 | </para> |
@@ -184,6 +184,21 @@ echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978)); |
184 | 184 | $loc_de = setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge'); |
185 | 185 | echo "A localidade preferida para alemão neste sistema é '$loc_de'"; |
186 | 186 | ?> |
| 187 | +]]> |
| 188 | + </programlisting> |
| 189 | + </example> |
| 190 | + </para> |
| 191 | + <para> |
| 192 | + <example> |
| 193 | + <title>Recuperando a configuração atual de <function>setlocale</function></title> |
| 194 | + <programlisting role="php" annotations="non-interactive"> |
| 195 | +<![CDATA[ |
| 196 | +<?php |
| 197 | +/* Recuperando a configuração atual */ |
| 198 | +$current = setlocale(LC_ALL, null); |
| 199 | +
|
| 200 | +echo "Localidade atual: '$current'"; |
| 201 | +?> |
187 | 202 | ]]> |
188 | 203 | </programlisting> |
189 | 204 | </example> |
|
0 commit comments