mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-27 18:32:09 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@172818 c90b9560-bf6c-de11-be94-00142212c4b1
122 lines
3.9 KiB
XML
122 lines
3.9 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.12 $ -->
|
|
<!-- EN-Revision: 1.10 Maintainer: didou Status: ready -->
|
|
<refentry id="function.htmlentities">
|
|
<refnamediv>
|
|
<refname>htmlentities</refname>
|
|
<refpurpose>
|
|
Convertit tous les caractères éligibles en entités HTML
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>htmlentities</methodname>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>quote_style</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<methodname>htmlentities</methodname> est identique à la fonction
|
|
<function>htmlspecialchars</function>, sauf que tous les caractères
|
|
qui ont des équivalents en entités HTML sont effectivement
|
|
traduits.
|
|
</para>
|
|
<para>
|
|
Comme <function>htmlspecialchars</function>, cette
|
|
fonction prend un deuxième argument optionnel, qui indique
|
|
comment doivent être traités les guillemets doubles et simples.
|
|
Vous pouvez utiliser l'une des constantes suivantes la valeur par
|
|
défaut étant <constant>ENT_COMPAT</constant> :
|
|
<table>
|
|
<title>Constantes disponibles pour <parameter>quote_style</parameter></title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Nom</entry>
|
|
<entry>Description</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><constant>ENT_COMPAT</constant></entry>
|
|
<entry>Convertit les guillemets doubles, et ignore les guillemets simples</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>ENT_QUOTES</constant></entry>
|
|
<entry>Convertit les guillemets doubles et les guillemets simples</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>ENT_NOQUOTES</constant></entry>
|
|
<entry>Ignore les guillemets doubles et les guillemets simples</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
<para>
|
|
Le support du paramètre optionnel <parameter>quote</parameter> a été ajouté
|
|
en &php; 4.0.3.
|
|
</para>
|
|
<para>
|
|
Comme <function>htmlspecialchars</function>, cette fonction prend un
|
|
troisième argument optionnel qui définit le jeux de caractères
|
|
utilisé durant la conversion. Le support de cet argument a été
|
|
ajouté en &php; 4.1.0. Actuellement, le jeu de caractères
|
|
ISO-8859-1 est utilisé par défaut.
|
|
</para>
|
|
&reference.strings.charsets;
|
|
<para>
|
|
Si vous voulez réaliser l'opération inverse, vous devez utiliser
|
|
la fonction <function>html_entity_decode</function>.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>htmlentities</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$str = 'Un \'apostrophe\' en <strong>gras</strong>';
|
|
|
|
// Affiche : Un 'apostrophe' en <strong>gras</strong>
|
|
echo htmlentities($str);
|
|
|
|
// Affiche : Un 'apostrophe' en <strong>gras</strong>
|
|
echo htmlentities($str, ENT_QUOTES);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Voir aussi
|
|
<function>html_entity_decode</function>,
|
|
<function>get_html_translation_table</function>,
|
|
<function>htmlspecialchars</function>,
|
|
<function>nl2br</function> et
|
|
<function>urlencode</function>.
|
|
</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:"../../../../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
|
|
-->
|