cvs: phpdoc-da /reference/strings/functions htmlentities.xml

[email protected] ("Jonathan Holst") Tue, 14 Jun 2005 22:55:56 -0000
Newsgroups php.doc.da
Message-ID <cvsholst1118789756@cvsserver>
holst		Tue Jun 14 18:55:56 2005 EDT

  Added files:                 
    /phpdoc-da/reference/strings/functions	htmlentities.xml 
  Log:
  Initial translation
  

http://cvs.php.net/co.php/phpdoc-da/reference/strings/functions/htmlentities.xml?r=1.1&p=1
Index: phpdoc-da/reference/strings/functions/htmlentities.xml
+++ phpdoc-da/reference/strings/functions/htmlentities.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- EN-Revision: 1.10 Maintainer: holst Status: ready -->
  <refentry id="function.htmlentities">
   <refnamediv>
    <refname>htmlentities</refname>
    <refpurpose>
     Koverter alle anvendelige tegn til HTML-entiteter
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Beskrivelse</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>
     Denne funktion er identisk med <function>htmlspecialchars</function> på
     alle måder, bortset fra at med <function>htmlentities</function> bliver
     alle tegn som har HTML-entitets ækvivalenter oversat til disse entiteter
    </para>
    <para>
     Ligesom <function>htmlspecialchars</function> giver den valgfrie anden
     parameter, <parameter>quote_style</parameter>, dig mulighed for at
     definere hvad du vil have gjort med 'enkelte' og "dobbelte"
     citationstegn. Den kan tage en af tre konstanter, som standard værende
     <constant>ENT_COMPAT</constant>:
     <table>
      <title>Tilgængeligee <parameter>quote_style</parameter> konstanter</title>
      <tgroup cols="2">
       <thead>
        <row>
         <entry>Konstantnavn</entry>
         <entry>Beskrivelse</entry>
        </row>
       </thead>
       <tbody>
        <row>
         <entry><constant>ENT_COMPAT</constant></entry>
         <entry>Vil ændre dobbelte, men ikke enkelte citationstegn.</entry>
        </row>
        <row>
         <entry><constant>ENT_QUOTES</constant></entry>
         <entry>Vil ændre både dobbelte og enkelte citationstegn.</entry>
        </row>
        <row>
         <entry><constant>ENT_NOQUOTES</constant></entry>
         <entry>Vil hverken ændre dobbelte eller enkelte citationstegn.</entry>
        </row>
       </tbody>
      </tgroup>
     </table>
    </para>
    <para>
     Understøttelse af den valgfrie parameter <parameter>quote</parameter>
     blev tilføjet i PHP 4.0.3.
    </para>
    <para>
     Ligesom <function>htmlspecialchars</function> tager den en valgfri tredje
     parameter <parameter>charset</parameter> som definerer tegnsættet brugt i
     konverteringen. Understøttelse af denne parameter blev tilføjet i PHP
     4.1.0. I øjeblikket bliver ISO-8859-1 tegnsættet brugt som standard.
    </para>
    &reference.strings.charsets;
    <para>
     Hvis du ønsker at dekode istedet (det modsatte) kan du bruge
     <function>html_entity_decode</function>.
    </para>
    <para>
     <example>
      <title>Et <function>htmlentities</function> eksempel</title>
      <programlisting role="php">
<![CDATA[
<?php
$str = "Et 'citat' er <b>stærkt</b>";

// Outputs: Et 'citat' er &lt;b&gt;stærkt&lt;/b&gt;
echo htmlentities($str);

// Outputs: Et &#039;citat&#039; er &lt;b&gt;stærkt&lt;/b&gt;
echo htmlentities($str, ENT_QUOTES);
?>
]]>
      </programlisting>
     </example>
    </para>
    <para>
     Se også <function>html_entity_decode</function>, 
     <function>get_html_translation_table</function>,
     <function>htmlspecialchars</function>, <function>nl2br</function>,
     og <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
-->