mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
195 lines
5.8 KiB
XML
195 lines
5.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: d6f54016d62904cfd8200604aadd5e3f0d9bad97 Maintainer: leonardolara Status: ready --><!-- CREDITS: fernandowobeto,leonardolara -->
|
|
<refentry xml:id="function.mb-convert-case" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>mb_convert_case</refname>
|
|
<refpurpose>Realiza a conversão de caixa em uma string</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_convert_case</methodname>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Realiza a conversão de caixa em uma <type>string</type>, convertida da maneira especificada por
|
|
<parameter>mode</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>string</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
A <type>string</type> sendo convertida.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>mode</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
O modo de conversão. Pode ser um dos
|
|
<constant>MB_CASE_UPPER</constant>,
|
|
<constant>MB_CASE_LOWER</constant>,
|
|
<constant>MB_CASE_TITLE</constant>,
|
|
<constant>MB_CASE_FOLD</constant>,
|
|
<constant>MB_CASE_UPPER_SIMPLE</constant>,
|
|
<constant>MB_CASE_LOWER_SIMPLE</constant>,
|
|
<constant>MB_CASE_TITLE_SIMPLE</constant>,
|
|
<constant>MB_CASE_FOLD_SIMPLE</constant>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>encoding</parameter></term>
|
|
<listitem>
|
|
&mbstring.encoding.parameter;
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Uma versão da <parameter>string</parameter> com conversão de caixa conforme
|
|
especificado por <parameter>mode</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.3.0</entry>
|
|
<entry>
|
|
Implementadas regras condicionais de maiúsculas/minúsculas para a letra grega sigma
|
|
que só se aplicam aos modos <constant>MB_CASE_LOWER</constant>
|
|
e <constant>MB_CASE_TITLE</constant>, e não
|
|
a <constant>MB_CASE_LOWER_SIMPLE</constant> e
|
|
<constant>MB_CASE_TITLE_SIMPLE</constant>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>7.3.0</entry>
|
|
<entry>
|
|
Adicionado suporte para
|
|
<constant>MB_CASE_FOLD</constant>,
|
|
<constant>MB_CASE_UPPER_SIMPLE</constant>,
|
|
<constant>MB_CASE_LOWER_SIMPLE</constant>,
|
|
<constant>MB_CASE_TITLE_SIMPLE</constant>, e
|
|
<constant>MB_CASE_FOLD_SIMPLE</constant>
|
|
como <parameter>mode</parameter>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <function>mb_convert_case</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$str = "mary had a Little lamb and she loved it so";
|
|
$str = mb_convert_case($str, MB_CASE_UPPER, "UTF-8");
|
|
echo $str, PHP_EOL;
|
|
$str = mb_convert_case($str, MB_CASE_TITLE, "UTF-8");
|
|
echo $str, PHP_EOL;
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <function>mb_convert_case</function> com texto UTF-8 não latino</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$str = "Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός";
|
|
$str = mb_convert_case($str, MB_CASE_UPPER, "UTF-8");
|
|
echo $str, PHP_EOL;
|
|
$str = mb_convert_case($str, MB_CASE_TITLE, "UTF-8");
|
|
echo $str, PHP_EOL;
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<para>
|
|
Ao contrário das funções padrão de conversão de caixa, como
|
|
<function>strtolower</function> e <function>strtoupper</function>,
|
|
a conversão de caixa é realizada com base nas propriedades dos caracteres Unicode.
|
|
Assim, o comportamento desta função não é afetado pelas configurações de localidade e ela pode converter qualquer caractere que tenha
|
|
a propriedade 'alfabética', como o a-umlaut (ä).
|
|
</para>
|
|
<para>
|
|
Para obter mais informações sobre as propriedades Unicode, consulte <link
|
|
xlink:href="&url.unicode.reports;">&url.unicode.reports;</link>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>mb_strtolower</function></member>
|
|
<member><function>mb_strtoupper</function></member>
|
|
<member><function>strtolower</function></member>
|
|
<member><function>strtoupper</function></member>
|
|
<member><function>ucfirst</function></member>
|
|
<member><function>ucwords</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|