mirror of
https://github.com/php/doc-ja.git
synced 2026-04-23 07:58:01 +02:00
0f9e93d57f
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@189166 c90b9560-bf6c-de11-be94-00142212c4b1
126 lines
4.2 KiB
XML
126 lines
4.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision: 1.6 $ -->
|
|
<!-- splitted from ./ja/functions/strings.xml, last change in rev 1.1 -->
|
|
<!-- EN-Revision: 1.10 Maintainer: hirokawa Status: ready -->
|
|
<!-- CREDITS: shimooka -->
|
|
<refentry id="function.htmlentities">
|
|
<refnamediv>
|
|
<refname>htmlentities</refname>
|
|
<refpurpose>
|
|
適用可能な文字を全てHTMLエンティティに変換する
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>説明</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>htmlentities</methodname>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>
|
|
<replaceable><optional>quote_style</optional></replaceable>
|
|
</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>
|
|
<replaceable><optional>charset</optional></replaceable>
|
|
</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
この関数は<function>htmlspecialchars</function>と同じですが、
|
|
HTML エンティティと等価な意味を有する文字をHTMLエンティティに変換
|
|
します。
|
|
</para>
|
|
<para>
|
|
<function>htmlspecialchars</function>と同様に、シングルまたは
|
|
ダブルクオートに関する動作を示すオプションの第2の引数をとります。
|
|
これはデフォルトが <constant>ENT_COMPAT</constant> である
|
|
3 つの定数のうちの一つを取ります。
|
|
<table>
|
|
<title>利用可能な <parameter>quote_style</parameter> 定数</title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>定数名</entry>
|
|
<entry>説明</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><constant>ENT_COMPAT</constant></entry>
|
|
<entry>ダブルクオートのみを変換し、
|
|
シングルクオートをそのままにします</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>ENT_QUOTES</constant></entry>
|
|
<entry>ダブルおよびシングルクオートを共に変換します</entry>
|
|
</row>
|
|
<row>
|
|
<entry><constant>ENT_NOQUOTES</constant></entry>
|
|
<entry>ダブルクオートおよびシングルクオートを共に変換しません</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
<para>
|
|
オプションパラメータ <parameter>quote</parameter> のサポートは、
|
|
PHP 4.0.3 で追加されました。
|
|
</para>
|
|
<para>
|
|
<function>htmlspecialchars</function>と同様に、この関数はオプショ
|
|
ンの3番目の引数 <parameter>charset</parameter> をとり、
|
|
変換に使用される文字セットを指定可能です。
|
|
この引数はPHP 4.1.0で追加されました。現在のところ、ISO-8859-1
|
|
文字セットがデフォルトの文字エンコーディングとして使用されます。
|
|
</para>
|
|
&reference.strings.charsets;
|
|
<para>
|
|
もしデコード (逆の処理) をしたい場合、
|
|
<function>html_entity_decode</function> を使用することができます。
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>htmlentities</function> の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$str = "A 'quote' is <b>bold</b>";
|
|
|
|
// 出力: A 'quote' is <b>bold</b>
|
|
echo htmlentities($str);
|
|
|
|
// 出力: A 'quote' is <b>bold</b>
|
|
echo htmlentities($str, ENT_QUOTES);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<function>html_entity_decode</function>,
|
|
<function>get_html_translation_table</function>,
|
|
<function>htmlspecialchars</function>, <function>nl2br</function>,
|
|
<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
|
|
-->
|