mirror of
https://github.com/php/doc-pt_br.git
synced 2026-04-28 02:33:16 +02:00
169 lines
5.0 KiB
XML
169 lines
5.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: ca4b9d11a25fc9f8dde7561c504ed466ed1d6c63 Maintainer: fernandowobeto Status: ready --><!-- CREDITS: fernandowobeto -->
|
|
<refentry xml:id="function.mb-strimwidth" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>mb_strimwidth</refname>
|
|
<refpurpose>Obtém string truncada com largura especificada</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_strimwidth</methodname>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>start</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>width</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>trim_marker</parameter><initializer>""</initializer></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Trunca a <type>string</type> <parameter>string</parameter> para a largura especificada <parameter>width</parameter>,
|
|
onde caracteres de meia largura contam como <literal>1</literal>, e caracteres de largura total
|
|
contam como <literal>2</literal>.
|
|
Consulte <link xlink:href="&url.unicode.reports.tr;11/">&url.unicode.reports.tr;11/</link>
|
|
para detalhes sobre larguras de caracteres do leste asiático.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>string</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
A <type>string</type> a ser decodificada.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>start</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
O deslocamento da posição inicial. Número de
|
|
caracteres a partir do início da string (o primeiro caractere é 0),
|
|
ou se start for negativo, o número de caracteres a partir do final da string.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>width</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
A largura do corte desejado.
|
|
Se uma largura negativa for especificada, conta a partir do final da string.
|
|
<note>
|
|
<para>
|
|
Passar uma largura negativa foi descontinuado a partir do PHP 8.3.0.
|
|
</para>
|
|
</note>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>trim_marker</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Uma string que é adicionada ao final de string
|
|
quando a string é truncada.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>encoding</parameter></term>
|
|
<listitem>
|
|
&mbstring.encoding.parameter;
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
A <type>string</type> truncada. Se <parameter>trim_marker</parameter> estiver definido,
|
|
<parameter>trim_marker</parameter> substitui os últimos caracteres para corresponder à <parameter>width</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.3.0</entry>
|
|
<entry>
|
|
Passar uma largura negativa <parameter>width</parameter> para
|
|
<function>mb_strimwidth</function> agora foi descontinuado.
|
|
</entry>
|
|
</row>
|
|
&mbstring.changelog.encoding-nullable;
|
|
<row>
|
|
<entry>7.1.0</entry>
|
|
<entry>
|
|
Adicionado suporte para <parameter>start</parameter>s e <parameter>width</parameter>s negativos.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <function>mb_strimwidth</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
echo mb_strimwidth("Hello World", 0, 10, "...");
|
|
// saída: "Hello W..."
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>mb_strwidth</function></member>
|
|
<member><function>mb_internal_encoding</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
|
|
-->
|