mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-24 07:02:09 +01:00
157 lines
4.1 KiB
XML
157 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: ba50f222e7108287fb6eb11265c2b28efe0cc0ce Maintainer: leonardolara Status: ready -->
|
|
<refentry xml:id="function.highlight-string" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>highlight_string</refname>
|
|
<refpurpose>Destaque de sintaxe de uma string</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>string</type><type>true</type></type><methodname>highlight_string</methodname>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>return</parameter><initializer>&false;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
Mostra ou retorna uma marcação html para uma versão destacada do código PHP fornecido
|
|
usando as cores definidas no marcador de sintaxe integrado do PHP.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>string</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
O código PHP a ser destacado. Isso deve incluir a etiqueta de abertura.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>return</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Defina este parâmetro como &true; para fazer esta função
|
|
retornar o código destacado.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Se <parameter>return</parameter> estiver definido para &true;, retorna o código destacado
|
|
como uma string ao invés de exibi-lo.
|
|
Caso contrário, retorna &true;.
|
|
</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.4.0</entry>
|
|
<entry>
|
|
O tipo de retorno foi alterado de <type class="union"><type>string</type><type>bool</type></type> para <type class="union"><type>string</type><type>true</type></type>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>8.3.0</entry>
|
|
<entry>
|
|
O HTML resultante foi alterado.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <function>highlight_string</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
highlight_string('<?php phpinfo(); ?>');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
<code><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</code>
|
|
]]>
|
|
</screen>
|
|
&example.outputs.83;
|
|
<screen>
|
|
<![CDATA[
|
|
<pre><code style="color: #000000"><span style="color: #0000BB"><?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?></span></code></pre>
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
¬e.uses-ob;
|
|
<para>
|
|
A marcação HTML gerada está sujeita a alterações.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>highlight_file</function></member>
|
|
<member><link linkend="ini.syntax-highlighting">Diretivas INI para destaque</link></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
|
|
-->
|