1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-24 07:22:16 +01:00
Files
archived-doc-es/reference/misc/functions/highlight-string.xml
2025-07-03 23:32:26 +02:00

163 lines
4.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: ba50f222e7108287fb6eb11265c2b28efe0cc0ce Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="function.highlight-string" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>highlight_string</refname>
<refpurpose>Aplica la sintaxis colorizada a código PHP</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>
Muestra o devuelve el código HTML de la versión colorizada del código PHP contenido
en el argumento <parameter>str</parameter>, utilizando los colores del
sistema interno de coloración de PHP.
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<para>
El código PHP a colorizar. Debe incluir también las etiquetas de apertura.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>return</parameter></term>
<listitem>
<para>
Definir este argumento a &true; para que esta función devuelva
el código colorizado.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Si el segundo argumento opcional <parameter>return</parameter> es proporcionado,
y vale &true; entonces <function>highlight_string</function> devolverá
la cadena colorizada en lugar de mostrarla inmediatamente. Si el segundo
argumento no vale &true; entonces <function>highlight_string</function>
devolverá &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>
El tipo de retorno ha pasado de <type class="union"><type>string</type><type>bool</type></type> a <type class="union">
<type>string</type><type>true</type></type>.
</entry>
</row>
<row>
<entry>8.3.0</entry>
<entry>
El HTML resultante ha cambiado.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Ejemplo con <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">&lt;?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?&gt;</span>
</span>
</code>
]]>
</screen>
&example.outputs.83;
<screen>
<![CDATA[
<pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?&gt;</span></code></pre>
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&note.uses-ob;
<para>
El código HTML generado está sujeto a cambios.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>highlight_file</function></member>
<member><link linkend="ini.syntax-highlighting">Las directivas INI de coloración</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
-->