cvs: phpdoc-ja /reference/strings/functions substr-count.xml /reference/xml reference.xml /reference/zlib ini.xml

From: Date: Sun, 24 Jul 2005 04:30:23 +0000
Subject: cvs: phpdoc-ja /reference/strings/functions substr-count.xml /reference/xml reference.xml /reference/zlib ini.xml
Groups: php.doc.ja 
Request: Send a blank email to doc-ja+get-1061@lists.php.net to get a copy of this message
shimooka Sun Jul 24 00:30:23 2005 EDT Modified files: /phpdoc-ja/reference/strings/functions substr-count.xml /phpdoc-ja/reference/xml reference.xml /phpdoc-ja/reference/zlib ini.xml Log: translation updated

http://cvs.php.net/diff.php/phpdoc-ja/reference/strings/functions/substr-count.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-ja/reference/strings/functions/substr-count.xml diff -u phpdoc-ja/reference/strings/functions/substr-count.xml:1.4 phpdoc-ja/reference/strings/functions/substr-count.xml:1.5 --- phpdoc-ja/reference/strings/functions/substr-count.xml:1.4 Tue May 31 03:36:37 2005 +++ phpdoc-ja/reference/strings/functions/substr-count.xml Sun Jul 24 00:30:21 2005 @@ -1,46 +1,155 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- splitted from ./ja/functions/strings.xml, last change in rev 1.10 --> -<!-- EN-Revision: 1.6 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.27 --> -<!-- CREDITS: elf --> - <refentry id="function.substr-count"> - <refnamediv> - <refname>substr_count</refname> - <refpurpose>副文字列の出現回数を数える</refpurpose> - </refnamediv> - <refsect1> - <title>説明</title> - <methodsynopsis> - <type>int</type><methodname>substr_count</methodname> - <methodparam><type>string</type><parameter>haystrack</parameter></methodparam> - <methodparam><type>string</type><parameter>needle</parameter></methodparam> - </methodsynopsis> - <para> - <function>substr_count</function> は、文字列 - <parameter>haystack</parameter> の中での副文字列 - <parameter>needle</parameter> の出現回数を返します。 - <parameter>needle</parameter> - は英大小文字を区別することに注意してください。 - </para> - <para> - <example> - <title><function>substr_count</function> の例</title> - <programlisting role="php"> +<!-- EN-Revision: 1.8 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: elf, shimooka --> +<refentry id="function.substr-count"> + <refnamediv> + <refname>substr_count</refname> + <refpurpose>副文字列の出現回数を数える</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>int</type><methodname>substr_count</methodname> + <methodparam><type>string</type><parameter>haystack</parameter></methodparam> + <methodparam><type>string</type><parameter>needle</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam> + </methodsynopsis> + <para> + <function>substr_count</function> は、文字列 + <parameter>haystack</parameter> の中での副文字列 + <parameter>needle</parameter> の出現回数を返します。 + <parameter>needle</parameter> + は英大小文字を区別することに注意してください。 + </para> + <note> + <para> + この関数は重なり合う副文字列をカウントしません。以下の例を見てください ! + </para> + </note> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>haystack</parameter></term> + <listitem> + <para> + 検索対象の文字列 + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>needle</parameter></term> + <listitem> + <para> + 検索する副文字列 + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>offset</parameter></term> + <listitem> + <para> + 開始位置のオフセット + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>length</parameter></term> + <listitem> + <para> + 指定したオフセット以降に副文字列で検索する最大長。 + オフセットと長さの総和が <parameter>haystack</parameter> + の長さよりも長い場合、警告が発生します。 + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + この関数は <type>整数</type> を返します。 + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>5.1.0</entry> + <entry> + <parameter>offset</parameter> と <parameter>length</parameter> + パラメータが追加されました。 + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>substr_count</function> の例</title> + <programlisting role="php"> <![CDATA[ <?php -echo substr_count("This is a test", "is"); // 2 を出力する +$text = 'This is a test'; +echo strlen($text); // 14 + +echo substr_count($text, 'is'); // 2 + +// 文字列は 's is a test' になっているので, 1 が表示される +echo substr_count($text, 'is', 3); + +// テキストは 's i' になっているので, 0 が表示される +echo substr_count($text, 'is', 3, 3); + +// 5+10 > 14 なので、警告が発生する +echo substr_count($text, 'is', 5, 10); + + +// 重なっている副文字列はカウントされないので、1 が表示される +$text2 = 'gcdgcdgcd'; +echo substr_count($text2, 'gcdgcd'); ?> ]]> - </programlisting> - </example> - </para> - <simpara> - <function>count_chars</function>、 - <function>strpos</function>、<function>substr</function>、 - と <function>strstr</function> も参照してください。 - </simpara> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>count_chars</function></member> + <member><function>strpos</function></member> + <member><function>substr</function></member> + <member><function>strstr</function></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-ja/reference/xml/reference.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-ja/reference/xml/reference.xml diff -u phpdoc-ja/reference/xml/reference.xml:1.5 phpdoc-ja/reference/xml/reference.xml:1.6 --- phpdoc-ja/reference/xml/reference.xml:1.5 Tue Jan 4 10:08:38 2005 +++ phpdoc-ja/reference/xml/reference.xml Sun Jul 24 00:30:22 2005 @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.17 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.18 Maintainer: hirokawa Status: ready --> +<!-- CREDITS: shimooka --> <reference id="ref.xml"> <title>XML パーサ関数</title> <titleabbrev>XML</titleabbrev> @@ -32,7 +33,7 @@ linkend="function.xml-parser-create">XML パーサの作成</link> を行い、異なった XML イベントに関して<emphasis>ハンドラ </emphasis> を定義します。各XMLパーサーには、設定可能な小数の - <link linkend="function.xml-parser-set-option">パラメータ</link> + <link linkend="function.xml-parser-set-option">パラメータ</link> もあります。 </para> </section> @@ -51,7 +52,7 @@ ranlib $@ ]]> </programlisting> - expat のソース RPM パッケージが + expat のソース RPM パッケージが <ulink url="&url.expat.rpm;">&url.expat.rpm;</ulink> にあります。 </para> </section> @@ -157,7 +158,7 @@ への参照を見つけた際にコールされます。これは、例えば、ファ イルまたは URL への参照とすることが可能です。例としては、 <link linkend="example.xml-external-entity">外部エンティティ - の例</link> を参照ください。 + の例</link> を参照ください。 </entry> </row> </tbody> @@ -183,7 +184,7 @@ 毎にそれぞれ問い合わせ、制御することが可能です。 </para> </section> - + <section id="xml.error-codes"> <title>エラーコード</title> <para> @@ -215,12 +216,12 @@ </simplelist> </para> </section> - + <section id="xml.encoding"> <title>文字エンコーディング</title> <para> PHPのXML拡張機能は、異なった<glossterm>文字エンコーディング - </glossterm>を通じて<ulink url="&url.unicode;">Unicode</ulink> + </glossterm>を通じて<ulink url="&url.unicode;">Unicode</ulink> 文字セットをサポートします。<glossterm>ソースエンコーディング </glossterm>および<glossterm>ターゲットエンコーディング </glossterm>という2種類の文字エンコーディングがあります。 @@ -228,7 +229,7 @@ <literal>UTF-8</literal>でエンコードされます。 </para> <para> - ソースエンコーディングは、XMLドキュメントが + ソースエンコーディングは、XMLドキュメントが <link linkend="function.xml-parse">構文解析</link>された際に行わ れます。<link linkend="function.xml-parser-create">XML パーサの 作成</link>を行う際に、ソースエンコードを指定することができます。 @@ -321,12 +322,12 @@ <example> <title>XMLをHTMLにマップする</title> <para> - この例は、XMLドキュメントのタグを直接HTMLタグにマップします。 - "map array" にないエレメントは無視されます。もちろん、この例は、 - 特定の XML ドキュメント型を有する場合のみ動作します。 + この例は、XMLドキュメントのタグを直接HTMLタグにマップします。 + "map array" にないエレメントは無視されます。もちろん、この例は、 + 特定の XML ドキュメント型を有する場合のみ動作します。 </para> <para> - <programlisting role="php"> + <programlisting role="php"> <![CDATA[ <?php $file = "data.xml"; @@ -336,7 +337,7 @@ "LITERAL" => "TT" ); -function startElement($parser, $name, $attrs) +function startElement($parser, $name, $attrs) { global $map_array; if (isset($map_array[$name])) { @@ -344,7 +345,7 @@ } } -function endElement($parser, $name) +function endElement($parser, $name) { global $map_array; if (isset($map_array[$name])) { @@ -352,7 +353,7 @@ } } -function characterData($parser, $data) +function characterData($parser, $data) { echo $data; } @@ -376,7 +377,7 @@ xml_parser_free($xml_parser); ?> ]]> - </programlisting> + </programlisting> </para> </example> </para> @@ -403,39 +404,39 @@ <?php $file = "xmltest.xml"; -function trustedFile($file) +function trustedFile($file) { // only trust local files owned by ourselves - if (!eregi("^([a-z]+)://", $file) + if (!eregi("^([a-z]+)://", $file) && fileowner($file) == getmyuid()) { return true; } return false; } -function startElement($parser, $name, $attribs) +function startElement($parser, $name, $attribs) { echo "&lt;<font color=\"#0000cc\">$name</font>"; - if (sizeof($attribs)) { - while (list($k, $v) = each($attribs)) { - echo " <font color=\"#009900\">$k</font>=\"<font + if (count($attribs)) { + foreach ($attribs as $k => $v) { + echo " <font color=\"#009900\">$k</font>=\"<font color=\"#990000\">$v</font>\""; } } echo "&gt;"; } -function endElement($parser, $name) +function endElement($parser, $name) { echo "&lt;/<font color=\"#0000cc\">$name</font>&gt;"; } -function characterData($parser, $data) +function characterData($parser, $data) { echo "<b>$data</b>"; } -function PIHandler($parser, $target, $data) +function PIHandler($parser, $target, $data) { switch (strtolower($target)) { case "php": @@ -446,20 +447,20 @@ if (trustedFile($parser_file[$parser])) { eval($data); } else { - printf("Untrusted PHP code: <i>%s</i>", + printf("Untrusted PHP code: <i>%s</i>", htmlspecialchars($data)); } break; } } -function defaultHandler($parser, $data) +function defaultHandler($parser, $data) { if (substr($data, 0, 1) == "&" && substr($data, -1, 1) == ";") { - printf('<font color="#aa00aa">%s</font>', + printf('<font color="#aa00aa">%s</font>', htmlspecialchars($data)); } else { - printf('<font size="-1">%s</font>', + printf('<font size="-1">%s</font>', htmlspecialchars($data)); } } @@ -487,7 +488,7 @@ return false; } -function new_xml_parser($file) +function new_xml_parser($file) { global $parser_file; @@ -498,7 +499,7 @@ xml_set_processing_instruction_handler($xml_parser, "PIHandler"); xml_set_default_handler($xml_parser, "defaultHandler"); xml_set_external_entity_ref_handler($xml_parser, "externalEntityRefHandler"); - + if (!($fp = @fopen($file, "r"))) { return false; } http://cvs.php.net/diff.php/phpdoc-ja/reference/zlib/ini.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-ja/reference/zlib/ini.xml diff -u phpdoc-ja/reference/zlib/ini.xml:1.3 phpdoc-ja/reference/zlib/ini.xml:1.4 --- phpdoc-ja/reference/zlib/ini.xml:1.3 Sat Jun 18 11:53:19 2005 +++ phpdoc-ja/reference/zlib/ini.xml Sun Jul 24 00:30:23 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.9 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.10 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka --> <section id="zlib.configuration"> &reftitle.runtime; @@ -64,6 +64,7 @@ ヘッダを送信する場合に、ページは圧縮されます。 "Content-Encoding: gzip" (および "deflate") と "Vary: Accept-Encoding" ヘッダが出力に追加されます。 + 実行時、何らかのデータを送出する前にのみ設定することが可能です。 </para> <para> このオプションも論理値 "On"/"Off" のかわりに整数値をとることができ、
« previous php.doc.ja (#1061) next »