1
0
mirror of https://github.com/php/doc-pl.git synced 2026-03-24 15:12:16 +01:00
Files
archived-doc-pl/reference/misc/functions/highlight-string.xml
2025-02-20 07:58:21 +01:00

157 lines
4.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: ba50f222e7108287fb6eb11265c2b28efe0cc0ce Maintainer: sobak Status: ready -->
<refentry xml:id="function.highlight-string" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>highlight_string</refname>
<refpurpose>Koloruje składnię z ciągu znaków</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>
Wyświetla lub zwraca kod HTML dla pokolorowanej wersji podanego kodu PHP,
używając kolorów zdefiniowanych we wbudowanym mechanizmie podświetlania składni dla PHP.
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<para>
Kod PHP, który ma zostać pokolorowany. Powinien on zawierać znacznik otwierający.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>return</parameter></term>
<listitem>
<para>
Ustaw ten parametr na &true; aby ta funkcja zwracała
pokolorowany kod.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Jeśli parametr <parameter>return</parameter> jest ustawiony na &true;, to zwraca pokolorowany
kod jako ciąg znaków, zamiast go wyświetlać.
W przeciwnym razie zwraca &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>
Typ zwracanych danych zmieniony z <type class="union"><type>string</type><type>bool</type></type> na <type class="union"><type>string</type><type>true</type></type>.
</entry>
</row>
<row>
<entry>8.3.0</entry>
<entry>
Wynikowy kod HTML został zmieniony.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Przykład użycia <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>
Generowany kod HTML może podlegać zmianom.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>highlight_file</function></member>
<member><link linkend="ini.syntax-highlighting">Dyrektywy INI powiązane z kolorowaniem składni</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
-->