mirror of
https://github.com/php/doc-de.git
synced 2026-03-29 10:42:12 +02:00
git-svn-id: https://svn.php.net/repository/phpdoc/de/trunk@196755 c90b9560-bf6c-de11-be94-00142212c4b1
121 lines
4.1 KiB
XML
121 lines
4.1 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.7 $ -->
|
|
<!-- EN-Revision: 1.10 Maintainer: sammywg Status: working -->
|
|
<refentry id="function.htmlentities">
|
|
<refnamediv>
|
|
<refname>htmlentities</refname>
|
|
<refpurpose>
|
|
Wandelt alle geeigneten Zeichen in entsprechende HTML-Codes um
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Beschreibung</title>
|
|
<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>
|
|
Die Funktion ist komplett identisch zu <function>htmlspecialchars</function>,
|
|
allerdings wandelt <function>htmlentities</function> wirklich alle Zeichen,
|
|
die eine HTML-Code-Entsprechung haben, in diese Entsprechung um.
|
|
</para>
|
|
<para>
|
|
Wie bei <function>htmlspecialchars</function> können Sie mit dem
|
|
optionalen zweiten Parameter <parameter>quote_style</parameter>
|
|
definieren, wie 'einfache' und "doppelte" Anführungszeichen
|
|
behandelt werden. Es gibt drei Konstanten, wobei
|
|
<constant>ENT_COMPAT</constant> voreingestellt ist:
|
|
<table>
|
|
<title>Verfügbare <parameter>quote_style</parameter> Konstanten</title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Konstante</entry>
|
|
<entry>Beschreibung</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><constant>ENT_COMPAT</constant></entry>
|
|
<entry>Konvertiert nur doppelte Anführungszeichen und lässt einfache
|
|
Anführungszeichen unverändert.</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>ENT_QUOTES</constant></entry>
|
|
<entry>Konvertiert sowohl doppelte als auch einfache Anführungszeichen.</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>ENT_NOQUOTES</constant></entry>
|
|
<entry>Lässt doppelte und einfache Anführungszeichen unverändert.</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
<para>
|
|
Die Unterstützung für den optionalen Parameter
|
|
<parameter>quote</parameter> wurde in PHP 4.0.3. eingeführt.
|
|
</para>
|
|
<para>
|
|
Wie bei <function>htmlspecialchars</function> steht das optionale dritte
|
|
Argument <parameter>charset</parameter> zur Verfügung, das den für die
|
|
Konvertierung benötigten Zeichensatz definiert. Die Unterstützung für
|
|
dieses Argument wurden in PHP 4.1.0 eingeführt. Gegenwärtig
|
|
wird standardmäßig der ISO-8859-1 Zeichensatz verwendet.
|
|
</para>
|
|
&reference.strings.charsets;
|
|
<para>
|
|
Möchten Sie stattdessen die HTML Entities dekodieren, verwenden Sie
|
|
bitte die Funktion <function>html_entity_decode</function>.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Ein <function>htmlentities</function> Beispiel</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$str = "Ein 'Anführungszeichen' ist <b>fett</b>";
|
|
|
|
// Gibt aus: Ein 'Anführungszeichen' ist <b>fett</b>
|
|
echo htmlentities($str);
|
|
|
|
// Gibt aus: Ein 'Anführungszeichen' ist <b>fett</b>
|
|
echo htmlentities($str, ENT_QUOTES);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Siehe auch <function>html_entity_decode</function>,
|
|
<function>get_html_translation_table</function>,
|
|
<function>htmlspecialchars</function>,
|
|
<function>nl2br</function> und
|
|
<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
|
|
-->
|