mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-30 04:42:24 +02:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@166928 c90b9560-bf6c-de11-be94-00142212c4b1
96 lines
2.9 KiB
XML
96 lines
2.9 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.9 $ -->
|
|
<!-- EN-Revision: 1.5 Maintainer: dams Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry id="function.highlight-string">
|
|
<refnamediv>
|
|
<refname>highlight_string</refname>
|
|
<refpurpose>Applique la syntaxe colorisée à du code &php;</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>mixed</type><methodname>highlight_string</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>return</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
<function>highlight_string</function> affiche la version colorisée
|
|
du code &php; contenu dans le paramètre <parameter>str</parameter>, en
|
|
utilisant les couleurs du système interne de colorisation de &php;.
|
|
</simpara>
|
|
<simpara>
|
|
Si le second paramètre optionnel <parameter>return</parameter> est fourni,
|
|
et vaut &true; alors <function>highlight_string</function> retournera
|
|
la chaîne colorisée au lieu de l'afficher immédiatement. Si le second
|
|
paramètre ne vaut pas &true; alors <function>highlight_string</function>
|
|
retournera &true; en cas de succès, et &false; sinon.
|
|
</simpara>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>highlight_string</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
highlight_string('<?php phpinfo(); ?>');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Cette exemple affichera (en &php; 4):
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
<code><font color="#000000">
|
|
<font color="#0000BB"><?php phpinfo</font><font color="#007700">(); </font><font color="#0000BB">?></font>
|
|
</font>
|
|
</code>
|
|
]]>
|
|
</screen>
|
|
<para>
|
|
Cette exemple affichera (en &php; 5):
|
|
</para>
|
|
<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>
|
|
</para>
|
|
<note>
|
|
<simpara>
|
|
Le paramètre <parameter>return</parameter> est disponible depuis
|
|
&php; 4.2.0. Auparavant, il prenait la valeur par défaut de &false;
|
|
</simpara>
|
|
</note>
|
|
<simpara>
|
|
Voir aussi
|
|
<function>highlight_file</function> et
|
|
<function>show_source</function>.
|
|
</simpara>
|
|
</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:"../../../../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
|
|
--> |