com doc/zh: reformat: language/basic-syntax.xml reference/ftp/constants.xml reference/var/functions/boolval.xml reference/var/functions/intval.xml
reference/var/functions/is-bool.xml reference/var/functions/is-int.xml reference/var/functions/is-scalar.xml
| From: | Bole Chen | Date: | Sat, 20 Feb 2021 09:01:48 +0000 |
| Subject: | com doc/zh: reformat: language/basic-syntax.xml reference/ftp/constants.xml reference/var/functions/boolval.xml reference/var/functions/intval.xml reference/var/functions/is-bool.xml reference/var/functions/is-int.xml reference/var/functions/is-scalar.xml |
||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-5985@lists.php.net to get a copy of this message | ||
Commit: 005d05c6231207676e2cc5183641b31423952428
Author: Bole Chen <avenger@php.net> Sat, 20 Feb 2021 17:01:48 +0800
Parents: 9c83731e960cb5f0c4610bc02626d915693e5ba4
Branches: master
Link: http://git.php.net/?p=doc/zh.git;a=commitdiff;h=005d05c6231207676e2cc5183641b31423952428
Log:
reformat
Changed paths:
M language/basic-syntax.xml
M reference/ftp/constants.xml
M reference/var/functions/boolval.xml
M reference/var/functions/intval.xml
M reference/var/functions/is-bool.xml
M reference/var/functions/is-int.xml
M reference/var/functions/is-scalar.xml
diff --git a/language/basic-syntax.xml b/language/basic-syntax.xml index 4d8c193b..06180cef 100644 --- a/language/basic-syntax.xml +++ b/language/basic-syntax.xml @@ -19,21 +19,21 @@ PHP 有一个 echo 标记简写 <literal><?=</literal>, 它是更完整的 <code><?php echo</code> 的简写形式。 </para> - + <para> <example> <title>PHP 开始和结束标记</title> <programlisting role="php"> - <![CDATA[ - 1. <?php echo 'if you want to serve PHP code in XHTML or XML documents, - use these tags'; ?> - - 2. You can use the short echo tag to <?= 'print this string' ?>. - It's equivalent to <?php echo 'print this string' ?>. - - 3. <? echo 'this code is within short tags, but will only work '. - 'if short_open_tag is enabled'; ?> - ]]> +<![CDATA[ +1. <?php echo 'if you want to serve PHP code in XHTML or XML documents, + use these tags'; ?> + +2. You can use the short echo tag to <?= 'print this string' ?>. + It's equivalent to <?php echo 'print this string' ?>. + +3. <? echo 'this code is within short tags, but will only work '. + 'if short_open_tag is enabled'; ?> +]]> </programlisting> </example> </para> @@ -41,10 +41,9 @@ <para> 短标记 (第三个例子) 是被默认开启的,但是也可以通过 <link linkend="ini.short-open-tag">short_open_tag</link> - &php.ini; 来直接禁用。如果PHP在被安装时使用了 <option>--disable-short-tags</option> + &php.ini; 来直接禁用。如果PHP在被安装时使用了 <option>--disable-short-tags</option> 的配置,该功能则是被默认禁用的。 </para> - <para> <note> <para> @@ -59,45 +58,45 @@ PHP 开始输出这些空白,而脚本中此时并无输出的意图。 <informalexample> <programlisting role="php"> - <![CDATA[ - <?php - echo "Hello world"; - - // ... more code - - echo "Last statement"; - - // 脚本至此结束,并无 PHP 结束标记 - ]]> +<![CDATA[ +<?php +echo "Hello world"; + +// ... more code + +echo "Last statement"; + +// the script ends here with no PHP closing tag +]]> </programlisting> </informalexample> </para> - </sect1> + </sect1> - <sect1 xml:id="language.basic-syntax.phpmode"> - <title>从 HTML 中分离</title> - <para> - 凡是在一对开始和结束标记之外的内容都会被 - PHP 解析器忽略,这使得 PHP 文件可以具备混合内容。 可以使 PHP - 嵌入到 HTML 文档中去,如下例所示。 - <informalexample> - <programlisting role="php"> + <sect1 xml:id="language.basic-syntax.phpmode"> + <title>从 HTML 中分离</title> + <para> + 凡是在一对开始和结束标记之外的内容都会被 + PHP 解析器忽略,这使得 PHP 文件可以具备混合内容。 可以使 PHP + 嵌入到 HTML 文档中去,如下例所示。 + <informalexample> + <programlisting role="php"> <![CDATA[ <p>This is going to be ignored by PHP and displayed by the browser.</p> <?php echo 'While this is going to be parsed.'; ?> <p>This will also be ignored by PHP and displayed by the browser.</p> ]]> - </programlisting> - </informalexample> - 这将如预期中的运行,因为当 PHP 解释器碰到 ?> - 结束标记时就简单地将其后内容原样输出(除非马上紧接换行 - 见<link - linkend="language.basic-syntax.instruction-separation">指令分隔符</link>)直到碰到下一个开始标记;例外是处于条件语句中间时,此时 - PHP 解释器会根据条件判断来决定哪些输出,哪些跳过。见下例。 - </para> - <para> + </programlisting> + </informalexample> + 这将如预期中的运行,因为当 PHP 解释器碰到 ?> + 结束标记时就简单地将其后内容原样输出(除非马上紧接换行 - 见 + <link linkend="language.basic-syntax.instruction-separation">指令分隔符</link>)直到碰到下一个开始标记;例外是处于条件语句中间时,此时 + PHP 解释器会根据条件判断来决定哪些输出,哪些跳过。见下例。 + </para> + <para> 使用条件结构: - <example> - <title>使用条件的高级分离术</title> + <example> + <title>使用条件的高级分离术</title> <programlisting role="php"> <![CDATA[ <?php if ($expression == true): ?> @@ -107,9 +106,9 @@ <?php endif; ?> ]]> </programlisting> - </example> - 上例中 PHP 将跳过条件语句未达成的段落,即使该段落位于 PHP 开始和结束标记之外。由于 - PHP 解释器会在条件未达成时直接跳过该段条件语句块,因此 PHP 会根据条件来忽略之。 + </example> + 上例中 PHP 将跳过条件语句未达成的段落,即使该段落位于 PHP 开始和结束标记之外。由于 + PHP 解释器会在条件未达成时直接跳过该段条件语句块,因此 PHP 会根据条件来忽略之。 </para> <para> 要输出大段文本时,跳出 PHP 解析模式通常比将文本通过 @@ -117,13 +116,13 @@ </para> <para> <note> - <para> - 此外注意如果将 PHP 嵌入到 XML 或 XHTML - 中则需要使用 <code><?php ?></code> 标记以保持符合标准。 - </para> + <para> + 此外注意如果将 PHP 嵌入到 XML 或 XHTML 中则需要使用 + <code><?php ?></code> 标记以保持符合标准。 + </para> </note> - </para> - </sect1> + </para> + </sect1> <sect1 xml:id="language.basic-syntax.instruction-separation"> <title>指令分隔符</title> @@ -154,16 +153,16 @@ But newline now </para> <para> - 进入和退出PHP解析的例子: + 进入和退出 PHP 解析的例子: - <informalexample> - <programlisting role="php"> + <informalexample> + <programlisting role="php"> <![CDATA[ <?php - echo "This is a test"; + echo 'This is a test'; ?> -<?php echo "This is a test" ?> +<?php echo 'This is a test' ?> <?php echo 'We omitted the last closing tag'; ]]> @@ -178,62 +177,61 @@ But newline now </note> </para> </sect1> - <sect1 xml:id="language.basic-syntax.comments"> <title>注释</title> <para> PHP 支持 C,C++ 和 Unix Shell 风格(Perl 风格)的注释。例如: - <informalexample> - <programlisting role="php"> + + <informalexample> + <programlisting role="php"> <![CDATA[ <?php - echo "This is a test"; // This is a one-line c++ style comment + echo 'This is a test'; // This is a one-line c++ style comment /* This is a multi line comment yet another line of comment */ - echo "This is yet another test"; + echo 'This is yet another test'; echo 'One Final Test'; # This is a one-line shell-style comment ?> ]]> - </programlisting> - </informalexample> - </para> - <simpara> - 单行注释仅仅注释到行末或者当前的 PHP 代码块,视乎哪个首先出现。这意味着在 - <literal>// ... ?></literal> 或者 <literal># ... ?></literal> - 之后的 HTML 代码将被显示出来:?> - 跳出了 PHP 模式并返回了 HTML 模式,<literal>//</literal> 或 <literal>#</literal> - 并不能影响到这一点。 - - </simpara> - <para> - <informalexample> - <programlisting role="php"> + </programlisting> + </informalexample> + </para> + <simpara> + 单行注释仅仅注释到行末或者当前的 PHP 代码块,视乎哪个首先出现。这意味着在 + <literal>// ... ?></literal> 或者 <literal># ... ?></literal> + 之后的 HTML 代码将被显示出来:?> + 跳出了 PHP 模式并返回了 HTML 模式,<literal>//</literal> 或 <literal>#</literal> + 并不能影响到这一点。 + </simpara> + <para> + <informalexample> + <programlisting role="php"> <![CDATA[ <h1>This is an <?php # echo 'simple';?> example</h1> <p>The header above will say 'This is an example'.</p> ]]> - </programlisting> - </informalexample> - </para> - <simpara> - C 风格的注释在碰到第一个 <literal>*/</literal> - 时结束。要确保不要嵌套 C 风格的注释。试图注释掉一大块代码时很容易出现该错误。 - </simpara> - <para> - <informalexample> - <programlisting role="php"> + </programlisting> + </informalexample> + </para> + <simpara> + C 风格的注释在碰到第一个 <literal>*/</literal> + 时结束。要确保不要嵌套 C 风格的注释。试图注释掉一大块代码时很容易出现该错误。 + </simpara> + <para> + <informalexample> + <programlisting role="php"> <![CDATA[ <?php /* - echo "This is a test"; /* This comment will cause a problem */ + echo 'This is a test'; /* This comment will cause a problem */ */ ?> ]]> - </programlisting> - </informalexample> - </para> - </sect1> -</chapter> + </programlisting> + </informalexample> + </para> + </sect1> + </chapter> <!-- Keep this comment at the end of the file Local variables: diff --git a/reference/ftp/constants.xml b/reference/ftp/constants.xml index 9983cce2..def77236 100644 --- a/reference/ftp/constants.xml +++ b/reference/ftp/constants.xml @@ -8,7 +8,7 @@ <variablelist> <varlistentry xml:id="constant.ftp-ascii"> <term> - <constant>FTP_ASCII</constant> + <constant>FTP_ASCII</constant> (<type>int</type>) </term> <listitem> @@ -17,7 +17,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-autoseek"> <term> - <constant>FTP_AUTOSEEK</constant> + <constant>FTP_AUTOSEEK</constant> (<type>int</type>) </term> <listitem> @@ -28,7 +28,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-autoresume"> <term> - <constant>FTP_AUTORESUME</constant> + <constant>FTP_AUTORESUME</constant> (<type>int</type>) </term> <listitem> @@ -39,7 +39,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-failed"> <term> - <constant>FTP_FAILED</constant> + <constant>FTP_FAILED</constant> (<type>int</type>) </term> <listitem> @@ -50,7 +50,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-finished"> <term> - <constant>FTP_FINISHED</constant> + <constant>FTP_FINISHED</constant> (<type>int</type>) </term> <listitem> @@ -61,7 +61,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-moredata"> <term> - <constant>FTP_MOREDATA</constant> + <constant>FTP_MOREDATA</constant> (<type>int</type>) </term> <listitem> @@ -72,7 +72,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-text"> <term> - <constant>FTP_TEXT</constant> + <constant>FTP_TEXT</constant> (<type>int</type>) </term> <listitem> @@ -81,7 +81,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-binary"> <term> - <constant>FTP_BINARY</constant> + <constant>FTP_BINARY</constant> (<type>int</type>) </term> <listitem> @@ -90,7 +90,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-image"> <term> - <constant>FTP_IMAGE</constant> + <constant>FTP_IMAGE</constant> (<type>int</type>) </term> <listitem> @@ -99,7 +99,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-timeout-sec"> <term> - <constant>FTP_TIMEOUT_SEC</constant> + <constant>FTP_TIMEOUT_SEC</constant> (<type>int</type>) </term> <listitem> @@ -110,12 +110,13 @@ </varlistentry> <varlistentry xml:id="constant.ftp-usepasvaddress"> <term> - <constant>FTP_USEPASVADDRESS</constant> + <constant>FTP_USEPASVADDRESS</constant> (<type>bool</type>) </term> <listitem> <para> - 更多信息请参考 <function>ftp_set_option</function>。自 PHP 5.6.0 版本起可用。 + 更多信息请参考 <function>ftp_set_option</function>。自 + PHP 5.6.0 版本起可用。 </para> </listitem> </varlistentry> diff --git a/reference/var/functions/boolval.xml b/reference/var/functions/boolval.xml index bc8dbd8a..56e316ae 100644 --- a/reference/var/functions/boolval.xml +++ b/reference/var/functions/boolval.xml @@ -2,7 +2,6 @@ <!-- $Revision$ --> <!-- EN-Revision: 0c9c2dd669fe9395eaa73d487fbd160f9057429a Maintainer: Haohappy Status: ready --> <!-- Reviewed: no --> - <refentry xml:id="function.boolval" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>boolval</refname> diff --git a/reference/var/functions/intval.xml b/reference/var/functions/intval.xml index 3433039a..32c0f095 100644 --- a/reference/var/functions/intval.xml +++ b/reference/var/functions/intval.xml @@ -15,9 +15,10 @@ <methodparam choice="opt"><type>int</type><parameter>base</parameter><initializer>10</initializer></methodparam> </methodsynopsis> <para> - 通过使用指定的进制 <parameter>base</parameter> 转换(默认是十进制),返回变量 <parameter>value</parameter> - 的 <type>int</type> 数值。 - <function>intval</function> 不能用于 object,否则会产生 <constant>E_NOTICE</constant> 错误并返回 1。 + 通过使用指定的进制 <parameter>base</parameter> 转换(默认是十进制),返回变量 <parameter>value</parameter> + 的 <type>int</type> 数值。 + <function>intval</function> 不能用于 object,否则会产生 + <constant>E_NOTICE</constant> 错误并返回 1。 </para> </refsect1> @@ -41,7 +42,8 @@ </para> <note> <para> - 如果 <parameter>base</parameter> 是 0,通过检测 <parameter>var</parameter> 的格式来决定使用的进制: + 如果 <parameter>base</parameter> 是 0,通过检测 + <parameter>var</parameter> 的格式来决定使用的进制: <itemizedlist> <listitem> <simpara> @@ -74,14 +76,14 @@ 空的 array 返回 0,非空的 array 返回 1。 </para> <para> - 最大的值取决于操作系统。 32 位系统最大带符号的 integer 范围是 -2147483648 到 2147483647。举例,在这样的系统上, <literal>intval('1000000000000')</literal> 会返回 - 2147483647。64 位系统上,最大带符号的 integer 值是 + 最大的值取决于操作系统。 32 位系统最大带符号的 integer 范围是 -2147483648 到 2147483647。举例,在这样的系统上,<literal>intval('1000000000000')</literal> 会返回 + 2147483647。64 位系统上,最大带符号的 integer 值是 9223372036854775807。 </para> <para> - 字符串有可能返回 0,虽然取决于字符串最左侧的字符。 + 字符串有可能返回 0,虽然取决于字符串最左侧的字符。 使用 - <link linkend="language.types.integer.casting">整型转换</link> + <link linkend="language.types.integer.casting">整型转换</link> 的共同规则。 </para> </refsect1> @@ -127,7 +129,8 @@ echo intval(true); // 1 &reftitle.notes; <note> <para> - 除非 <parameter>var</parameter> 是一个字符串,否则 <parameter>base</parameter> 不会起作用。 + 除非 <parameter>var</parameter> 是一个字符串,否则 + <parameter>base</parameter> 不会起作用。 </para> </note> </refsect1> diff --git a/reference/var/functions/is-bool.xml b/reference/var/functions/is-bool.xml index c92b4b19..d8997bb4 100644 --- a/reference/var/functions/is-bool.xml +++ b/reference/var/functions/is-bool.xml @@ -37,7 +37,7 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - 如果 <parameter>value</parameter> 是布尔值则返回 &true; ,否则返回 &false; 。 + 如果 <parameter>value</parameter> 是布尔值则返回 &true;,否则返回 &false;。 </para> </refsect1> <refsect1 role="examples"> diff --git a/reference/var/functions/is-int.xml b/reference/var/functions/is-int.xml index 602036cc..009aa3fd 100644 --- a/reference/var/functions/is-int.xml +++ b/reference/var/functions/is-int.xml @@ -41,7 +41,8 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - 如果 <parameter>value</parameter> 是 <type>int</type> ,则返回 &true; ,否则返回 &false; 。 + 如果 <parameter>value</parameter> 是 <type>int</type>,则返回 &true;,否则返回 + &false;。 </para> </refsect1> diff --git a/reference/var/functions/is-scalar.xml b/reference/var/functions/is-scalar.xml index a692afd7..44754b7b 100644 --- a/reference/var/functions/is-scalar.xml +++ b/reference/var/functions/is-scalar.xml @@ -20,7 +20,7 @@ 检测变量是否为标量 </para> <para> - 标量变量是指 <type>int</type> 、 <type>float</type> 、 <type>string</type> 或 <type>bool</type> 类型的变量。 + 标量变量是指 <type>int</type>、<type>float</type>、<type>string</type> 或 <type>bool</type> 类型的变量。 <type>array</type>、<type>object</type> 和 <type>resource</type> 类型不是标量。 </para> <note>
diff --git a/language/basic-syntax.xml b/language/basic-syntax.xml index 4d8c193b..06180cef 100644 --- a/language/basic-syntax.xml +++ b/language/basic-syntax.xml @@ -19,21 +19,21 @@ PHP 有一个 echo 标记简写 <literal><?=</literal>, 它是更完整的 <code><?php echo</code> 的简写形式。 </para> - + <para> <example> <title>PHP 开始和结束标记</title> <programlisting role="php"> - <![CDATA[ - 1. <?php echo 'if you want to serve PHP code in XHTML or XML documents, - use these tags'; ?> - - 2. You can use the short echo tag to <?= 'print this string' ?>. - It's equivalent to <?php echo 'print this string' ?>. - - 3. <? echo 'this code is within short tags, but will only work '. - 'if short_open_tag is enabled'; ?> - ]]> +<![CDATA[ +1. <?php echo 'if you want to serve PHP code in XHTML or XML documents, + use these tags'; ?> + +2. You can use the short echo tag to <?= 'print this string' ?>. + It's equivalent to <?php echo 'print this string' ?>. + +3. <? echo 'this code is within short tags, but will only work '. + 'if short_open_tag is enabled'; ?> +]]> </programlisting> </example> </para> @@ -41,10 +41,9 @@ <para> 短标记 (第三个例子) 是被默认开启的,但是也可以通过 <link linkend="ini.short-open-tag">short_open_tag</link> - &php.ini; 来直接禁用。如果PHP在被安装时使用了 <option>--disable-short-tags</option> + &php.ini; 来直接禁用。如果PHP在被安装时使用了 <option>--disable-short-tags</option> 的配置,该功能则是被默认禁用的。 </para> - <para> <note> <para> @@ -59,45 +58,45 @@ PHP 开始输出这些空白,而脚本中此时并无输出的意图。 <informalexample> <programlisting role="php"> - <![CDATA[ - <?php - echo "Hello world"; - - // ... more code - - echo "Last statement"; - - // 脚本至此结束,并无 PHP 结束标记 - ]]> +<![CDATA[ +<?php +echo "Hello world"; + +// ... more code + +echo "Last statement"; + +// the script ends here with no PHP closing tag +]]> </programlisting> </informalexample> </para> - </sect1> + </sect1> - <sect1 xml:id="language.basic-syntax.phpmode"> - <title>从 HTML 中分离</title> - <para> - 凡是在一对开始和结束标记之外的内容都会被 - PHP 解析器忽略,这使得 PHP 文件可以具备混合内容。 可以使 PHP - 嵌入到 HTML 文档中去,如下例所示。 - <informalexample> - <programlisting role="php"> + <sect1 xml:id="language.basic-syntax.phpmode"> + <title>从 HTML 中分离</title> + <para> + 凡是在一对开始和结束标记之外的内容都会被 + PHP 解析器忽略,这使得 PHP 文件可以具备混合内容。 可以使 PHP + 嵌入到 HTML 文档中去,如下例所示。 + <informalexample> + <programlisting role="php"> <![CDATA[ <p>This is going to be ignored by PHP and displayed by the browser.</p> <?php echo 'While this is going to be parsed.'; ?> <p>This will also be ignored by PHP and displayed by the browser.</p> ]]> - </programlisting> - </informalexample> - 这将如预期中的运行,因为当 PHP 解释器碰到 ?> - 结束标记时就简单地将其后内容原样输出(除非马上紧接换行 - 见<link - linkend="language.basic-syntax.instruction-separation">指令分隔符</link>)直到碰到下一个开始标记;例外是处于条件语句中间时,此时 - PHP 解释器会根据条件判断来决定哪些输出,哪些跳过。见下例。 - </para> - <para> + </programlisting> + </informalexample> + 这将如预期中的运行,因为当 PHP 解释器碰到 ?> + 结束标记时就简单地将其后内容原样输出(除非马上紧接换行 - 见 + <link linkend="language.basic-syntax.instruction-separation">指令分隔符</link>)直到碰到下一个开始标记;例外是处于条件语句中间时,此时 + PHP 解释器会根据条件判断来决定哪些输出,哪些跳过。见下例。 + </para> + <para> 使用条件结构: - <example> - <title>使用条件的高级分离术</title> + <example> + <title>使用条件的高级分离术</title> <programlisting role="php"> <![CDATA[ <?php if ($expression == true): ?> @@ -107,9 +106,9 @@ <?php endif; ?> ]]> </programlisting> - </example> - 上例中 PHP 将跳过条件语句未达成的段落,即使该段落位于 PHP 开始和结束标记之外。由于 - PHP 解释器会在条件未达成时直接跳过该段条件语句块,因此 PHP 会根据条件来忽略之。 + </example> + 上例中 PHP 将跳过条件语句未达成的段落,即使该段落位于 PHP 开始和结束标记之外。由于 + PHP 解释器会在条件未达成时直接跳过该段条件语句块,因此 PHP 会根据条件来忽略之。 </para> <para> 要输出大段文本时,跳出 PHP 解析模式通常比将文本通过 @@ -117,13 +116,13 @@ </para> <para> <note> - <para> - 此外注意如果将 PHP 嵌入到 XML 或 XHTML - 中则需要使用 <code><?php ?></code> 标记以保持符合标准。 - </para> + <para> + 此外注意如果将 PHP 嵌入到 XML 或 XHTML 中则需要使用 + <code><?php ?></code> 标记以保持符合标准。 + </para> </note> - </para> - </sect1> + </para> + </sect1> <sect1 xml:id="language.basic-syntax.instruction-separation"> <title>指令分隔符</title> @@ -154,16 +153,16 @@ But newline now </para> <para> - 进入和退出PHP解析的例子: + 进入和退出 PHP 解析的例子: - <informalexample> - <programlisting role="php"> + <informalexample> + <programlisting role="php"> <![CDATA[ <?php - echo "This is a test"; + echo 'This is a test'; ?> -<?php echo "This is a test" ?> +<?php echo 'This is a test' ?> <?php echo 'We omitted the last closing tag'; ]]> @@ -178,62 +177,61 @@ But newline now </note> </para> </sect1> - <sect1 xml:id="language.basic-syntax.comments"> <title>注释</title> <para> PHP 支持 C,C++ 和 Unix Shell 风格(Perl 风格)的注释。例如: - <informalexample> - <programlisting role="php"> + + <informalexample> + <programlisting role="php"> <![CDATA[ <?php - echo "This is a test"; // This is a one-line c++ style comment + echo 'This is a test'; // This is a one-line c++ style comment /* This is a multi line comment yet another line of comment */ - echo "This is yet another test"; + echo 'This is yet another test'; echo 'One Final Test'; # This is a one-line shell-style comment ?> ]]> - </programlisting> - </informalexample> - </para> - <simpara> - 单行注释仅仅注释到行末或者当前的 PHP 代码块,视乎哪个首先出现。这意味着在 - <literal>// ... ?></literal> 或者 <literal># ... ?></literal> - 之后的 HTML 代码将被显示出来:?> - 跳出了 PHP 模式并返回了 HTML 模式,<literal>//</literal> 或 <literal>#</literal> - 并不能影响到这一点。 - - </simpara> - <para> - <informalexample> - <programlisting role="php"> + </programlisting> + </informalexample> + </para> + <simpara> + 单行注释仅仅注释到行末或者当前的 PHP 代码块,视乎哪个首先出现。这意味着在 + <literal>// ... ?></literal> 或者 <literal># ... ?></literal> + 之后的 HTML 代码将被显示出来:?> + 跳出了 PHP 模式并返回了 HTML 模式,<literal>//</literal> 或 <literal>#</literal> + 并不能影响到这一点。 + </simpara> + <para> + <informalexample> + <programlisting role="php"> <![CDATA[ <h1>This is an <?php # echo 'simple';?> example</h1> <p>The header above will say 'This is an example'.</p> ]]> - </programlisting> - </informalexample> - </para> - <simpara> - C 风格的注释在碰到第一个 <literal>*/</literal> - 时结束。要确保不要嵌套 C 风格的注释。试图注释掉一大块代码时很容易出现该错误。 - </simpara> - <para> - <informalexample> - <programlisting role="php"> + </programlisting> + </informalexample> + </para> + <simpara> + C 风格的注释在碰到第一个 <literal>*/</literal> + 时结束。要确保不要嵌套 C 风格的注释。试图注释掉一大块代码时很容易出现该错误。 + </simpara> + <para> + <informalexample> + <programlisting role="php"> <![CDATA[ <?php /* - echo "This is a test"; /* This comment will cause a problem */ + echo 'This is a test'; /* This comment will cause a problem */ */ ?> ]]> - </programlisting> - </informalexample> - </para> - </sect1> -</chapter> + </programlisting> + </informalexample> + </para> + </sect1> + </chapter> <!-- Keep this comment at the end of the file Local variables: diff --git a/reference/ftp/constants.xml b/reference/ftp/constants.xml index 9983cce2..def77236 100644 --- a/reference/ftp/constants.xml +++ b/reference/ftp/constants.xml @@ -8,7 +8,7 @@ <variablelist> <varlistentry xml:id="constant.ftp-ascii"> <term> - <constant>FTP_ASCII</constant> + <constant>FTP_ASCII</constant> (<type>int</type>) </term> <listitem> @@ -17,7 +17,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-autoseek"> <term> - <constant>FTP_AUTOSEEK</constant> + <constant>FTP_AUTOSEEK</constant> (<type>int</type>) </term> <listitem> @@ -28,7 +28,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-autoresume"> <term> - <constant>FTP_AUTORESUME</constant> + <constant>FTP_AUTORESUME</constant> (<type>int</type>) </term> <listitem> @@ -39,7 +39,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-failed"> <term> - <constant>FTP_FAILED</constant> + <constant>FTP_FAILED</constant> (<type>int</type>) </term> <listitem> @@ -50,7 +50,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-finished"> <term> - <constant>FTP_FINISHED</constant> + <constant>FTP_FINISHED</constant> (<type>int</type>) </term> <listitem> @@ -61,7 +61,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-moredata"> <term> - <constant>FTP_MOREDATA</constant> + <constant>FTP_MOREDATA</constant> (<type>int</type>) </term> <listitem> @@ -72,7 +72,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-text"> <term> - <constant>FTP_TEXT</constant> + <constant>FTP_TEXT</constant> (<type>int</type>) </term> <listitem> @@ -81,7 +81,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-binary"> <term> - <constant>FTP_BINARY</constant> + <constant>FTP_BINARY</constant> (<type>int</type>) </term> <listitem> @@ -90,7 +90,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-image"> <term> - <constant>FTP_IMAGE</constant> + <constant>FTP_IMAGE</constant> (<type>int</type>) </term> <listitem> @@ -99,7 +99,7 @@ </varlistentry> <varlistentry xml:id="constant.ftp-timeout-sec"> <term> - <constant>FTP_TIMEOUT_SEC</constant> + <constant>FTP_TIMEOUT_SEC</constant> (<type>int</type>) </term> <listitem> @@ -110,12 +110,13 @@ </varlistentry> <varlistentry xml:id="constant.ftp-usepasvaddress"> <term> - <constant>FTP_USEPASVADDRESS</constant> + <constant>FTP_USEPASVADDRESS</constant> (<type>bool</type>) </term> <listitem> <para> - 更多信息请参考 <function>ftp_set_option</function>。自 PHP 5.6.0 版本起可用。 + 更多信息请参考 <function>ftp_set_option</function>。自 + PHP 5.6.0 版本起可用。 </para> </listitem> </varlistentry> diff --git a/reference/var/functions/boolval.xml b/reference/var/functions/boolval.xml index bc8dbd8a..56e316ae 100644 --- a/reference/var/functions/boolval.xml +++ b/reference/var/functions/boolval.xml @@ -2,7 +2,6 @@ <!-- $Revision$ --> <!-- EN-Revision: 0c9c2dd669fe9395eaa73d487fbd160f9057429a Maintainer: Haohappy Status: ready --> <!-- Reviewed: no --> - <refentry xml:id="function.boolval" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>boolval</refname> diff --git a/reference/var/functions/intval.xml b/reference/var/functions/intval.xml index 3433039a..32c0f095 100644 --- a/reference/var/functions/intval.xml +++ b/reference/var/functions/intval.xml @@ -15,9 +15,10 @@ <methodparam choice="opt"><type>int</type><parameter>base</parameter><initializer>10</initializer></methodparam> </methodsynopsis> <para> - 通过使用指定的进制 <parameter>base</parameter> 转换(默认是十进制),返回变量 <parameter>value</parameter> - 的 <type>int</type> 数值。 - <function>intval</function> 不能用于 object,否则会产生 <constant>E_NOTICE</constant> 错误并返回 1。 + 通过使用指定的进制 <parameter>base</parameter> 转换(默认是十进制),返回变量 <parameter>value</parameter> + 的 <type>int</type> 数值。 + <function>intval</function> 不能用于 object,否则会产生 + <constant>E_NOTICE</constant> 错误并返回 1。 </para> </refsect1> @@ -41,7 +42,8 @@ </para> <note> <para> - 如果 <parameter>base</parameter> 是 0,通过检测 <parameter>var</parameter> 的格式来决定使用的进制: + 如果 <parameter>base</parameter> 是 0,通过检测 + <parameter>var</parameter> 的格式来决定使用的进制: <itemizedlist> <listitem> <simpara> @@ -74,14 +76,14 @@ 空的 array 返回 0,非空的 array 返回 1。 </para> <para> - 最大的值取决于操作系统。 32 位系统最大带符号的 integer 范围是 -2147483648 到 2147483647。举例,在这样的系统上, <literal>intval('1000000000000')</literal> 会返回 - 2147483647。64 位系统上,最大带符号的 integer 值是 + 最大的值取决于操作系统。 32 位系统最大带符号的 integer 范围是 -2147483648 到 2147483647。举例,在这样的系统上,<literal>intval('1000000000000')</literal> 会返回 + 2147483647。64 位系统上,最大带符号的 integer 值是 9223372036854775807。 </para> <para> - 字符串有可能返回 0,虽然取决于字符串最左侧的字符。 + 字符串有可能返回 0,虽然取决于字符串最左侧的字符。 使用 - <link linkend="language.types.integer.casting">整型转换</link> + <link linkend="language.types.integer.casting">整型转换</link> 的共同规则。 </para> </refsect1> @@ -127,7 +129,8 @@ echo intval(true); // 1 &reftitle.notes; <note> <para> - 除非 <parameter>var</parameter> 是一个字符串,否则 <parameter>base</parameter> 不会起作用。 + 除非 <parameter>var</parameter> 是一个字符串,否则 + <parameter>base</parameter> 不会起作用。 </para> </note> </refsect1> diff --git a/reference/var/functions/is-bool.xml b/reference/var/functions/is-bool.xml index c92b4b19..d8997bb4 100644 --- a/reference/var/functions/is-bool.xml +++ b/reference/var/functions/is-bool.xml @@ -37,7 +37,7 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - 如果 <parameter>value</parameter> 是布尔值则返回 &true; ,否则返回 &false; 。 + 如果 <parameter>value</parameter> 是布尔值则返回 &true;,否则返回 &false;。 </para> </refsect1> <refsect1 role="examples"> diff --git a/reference/var/functions/is-int.xml b/reference/var/functions/is-int.xml index 602036cc..009aa3fd 100644 --- a/reference/var/functions/is-int.xml +++ b/reference/var/functions/is-int.xml @@ -41,7 +41,8 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - 如果 <parameter>value</parameter> 是 <type>int</type> ,则返回 &true; ,否则返回 &false; 。 + 如果 <parameter>value</parameter> 是 <type>int</type>,则返回 &true;,否则返回 + &false;。 </para> </refsect1> diff --git a/reference/var/functions/is-scalar.xml b/reference/var/functions/is-scalar.xml index a692afd7..44754b7b 100644 --- a/reference/var/functions/is-scalar.xml +++ b/reference/var/functions/is-scalar.xml @@ -20,7 +20,7 @@ 检测变量是否为标量 </para> <para> - 标量变量是指 <type>int</type> 、 <type>float</type> 、 <type>string</type> 或 <type>bool</type> 类型的变量。 + 标量变量是指 <type>int</type>、<type>float</type>、<type>string</type> 或 <type>bool</type> 类型的变量。 <type>array</type>、<type>object</type> 和 <type>resource</type> 类型不是标量。 </para> <note>