Skip to content

Commit aa763d3

Browse files
committed
Update apache/array
1 parent fe5fb30 commit aa763d3

File tree

9 files changed

+98
-87
lines changed

9 files changed

+98
-87
lines changed

language/predefined/variables/httpresponseheader.xml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: a6d209f4ff71ccba3f1255902827f5df3e092ff9 Maintainer: daijie Status: ready -->
3+
<!-- EN-Revision: 3f1cd5121f7c9f8347ca69c8f657fdb24c0f9729 Maintainer: daijie Status: ready -->
44
<!-- CREDITS: mowangjuanzi -->
55
<refentry role="variable" xml:id="reserved.variables.httpresponseheader" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" annotations="verify_info:false">
66
<refnamediv>
77
<refname>$http_response_header</refname>
88
<refpurpose>HTTP 响应头</refpurpose>
99
</refnamediv>
10-
10+
1111
<refsect1 role="description">
1212
&reftitle.description;
1313
<para>
@@ -63,9 +63,16 @@ NULL
6363
</example>
6464
</para>
6565
</refsect1>
66-
66+
67+
<refsect1 role="seealso">
68+
&reftitle.seealso;
69+
<simplelist>
70+
<member><function>http_get_last_response_headers</function></member>
71+
<member><function>http_clear_last_response_headers</function></member>
72+
</simplelist>
73+
</refsect1>
74+
6775
</refentry>
68-
6976
<!-- Keep this comment at the end of the file
7077
Local variables:
7178
mode: sgml

reference/apache/functions/apache-request-headers.xml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: f3b9d85f71934d6814a493fabb367e10731e0394 Maintainer: hytest Status: ready -->
4-
<!-- Reviewed: no -->
5-
3+
<!-- EN-Revision: 68e52ef14de33f6752a8fdda1ae83c861c5babdb Maintainer: hytest Status: ready -->
4+
<!-- CREDITS: mowangjuanzi -->
65
<!-- splitted from ./en/functions/apache.xml, last change in rev 1.2 -->
76
<refentry xml:id="function.apache-request-headers" xmlns="http://docbook.org/ns/docbook">
87
<refnamediv>
98
<refname>apache_request_headers</refname>
10-
<refpurpose>获取全部 HTTP 请求头信息</refpurpose>
9+
<refpurpose>获取全部 HTTP 请求 header</refpurpose>
1110
</refnamediv>
1211

1312
<refsect1 role="description">
@@ -17,8 +16,7 @@
1716
<void/>
1817
</methodsynopsis>
1918
<para>
20-
获取当前请求的所有请求头信息。
21-
可在 Apache、FastCGI、CLI、FPM 模式下运行。
19+
获取当前请求的所有请求 header。可在 Apache、FastCGI、CLI、FPM 模式下运行。
2220
</para>
2321
</refsect1>
2422

@@ -30,8 +28,7 @@
3028
<refsect1 role="returnvalues">
3129
&reftitle.returnvalues;
3230
<para>
33-
包含当前请求所有头信息的数组,失败返回
34-
&false;
31+
当前请求中所有 HTTP header 的关联数组。
3532
</para>
3633
</refsect1>
3734

reference/apache/functions/apache-response-headers.xml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: f3b9d85f71934d6814a493fabb367e10731e0394 Maintainer: hytest Status: ready -->
4-
<!-- Reviewed: no -->
5-
3+
<!-- EN-Revision: 68e52ef14de33f6752a8fdda1ae83c861c5babdb Maintainer: hytest Status: ready -->
4+
<!-- CREDITS: mowangjuanzi -->
65
<!-- splitted from ./en/functions/apache.xml, last change in rev 1.2 -->
76
<refentry xml:id="function.apache-response-headers" xmlns="http://docbook.org/ns/docbook">
87
<refnamediv>
98
<refname>apache_response_headers</refname>
10-
<refpurpose>获得全部 HTTP 响应头信息</refpurpose>
9+
<refpurpose>获得全部 HTTP 响应 header</refpurpose>
1110
</refnamediv>
1211

1312
<refsect1 role="description">
1413
&reftitle.description;
1514
<methodsynopsis>
16-
<type class="union"><type>array</type><type>false</type></type><methodname>apache_response_headers</methodname> <void/>
15+
<type>array</type><methodname>apache_response_headers</methodname>
16+
<void/>
1717
</methodsynopsis>
1818
<para>
19-
获得全部 HTTP 响应头信息。
20-
可在 Apache、FastCGI、CLI、FPM 模式下运行。
19+
获得全部 HTTP 响应 header。可在 Apache、FastCGI、CLI、FPM 模式下运行。
2120
</para>
2221
</refsect1>
2322

@@ -29,7 +28,7 @@
2928
<refsect1 role="returnvalues">
3029
&reftitle.returnvalues;
3130
<para>
32-
成功时返回包含全部 Apache 响应头信息的数组,&return.falseforfailure;.
31+
成功时返回全部 Apache 响应 header 的数组。
3332
</para>
3433
</refsect1>
3534

reference/apache/functions/getallheaders.xml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: f3b9d85f71934d6814a493fabb367e10731e0394 Maintainer: hytest Status: ready -->
4-
<!-- Reviewed: no -->
5-
3+
<!-- EN-Revision: 68e52ef14de33f6752a8fdda1ae83c861c5babdb Maintainer: hytest Status: ready -->
4+
<!-- CREDITS: mowangjuanzi -->
65
<!-- splitted from ./en/functions/apache.xml, last change in rev 1.2 -->
76
<refentry xml:id="function.getallheaders" xmlns="http://docbook.org/ns/docbook">
87
<refnamediv>
98
<refname>getallheaders</refname>
10-
<refpurpose>获取全部 HTTP 请求头信息</refpurpose>
9+
<refpurpose>获取全部 HTTP 请求 header</refpurpose>
1110
</refnamediv>
1211

1312
<refsect1 role="description">
@@ -20,9 +19,8 @@
2019
获取当前请求的所有请求头信息。
2120
</para>
2221
<para>
23-
此函数是 <function>apache_request_headers</function>的别名。
24-
请阅读 <function>apache_request_headers</function>
25-
文档获得更多信息。
22+
此函数是 <function>apache_request_headers</function> 的别名。请阅读
23+
<function>apache_request_headers</function> 文档获得更多信息。
2624
</para>
2725
</refsect1>
2826

@@ -34,8 +32,7 @@
3432
<refsect1 role="returnvalues">
3533
&reftitle.returnvalues;
3634
<para>
37-
包含当前请求所有头信息的数组,失败返回
38-
&false;
35+
当前请求中所有 HTTP header 的关联数组。
3936
</para>
4037
</refsect1>
4138

reference/array/functions/array-filter.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 1de7b5b65f959de3babdd8ea1b060f8cebd60856 Maintainer: HonestQiao Status: ready -->
4-
<!-- CREDITS: Luffy -->
3+
<!-- EN-Revision: 596c11440dc232b8ed1836d7e3afe2ed5b225a7b Maintainer: HonestQiao Status: ready -->
4+
<!-- CREDITS: Luffy, mowangjuanzi -->
55
<refentry xml:id="function.array-filter" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
77
<refname>array_filter</refname>
88
<refpurpose>使用回调函数过滤数组的元素</refpurpose>
99
</refnamediv>
10-
10+
1111
<refsect1 role="description">
1212
&reftitle.description;
1313
<methodsynopsis>
@@ -161,7 +161,7 @@ Array
161161
</screen>
162162
</example>
163163
<example>
164-
<title><function>array_filter</function> 不使用 <parameter>callback</parameter> 参数时</title>
164+
<title><function>array_filter</function> 不使用 <parameter>callback</parameter> </title>
165165
<programlisting role="php">
166166
<![CDATA[
167167
<?php
@@ -190,7 +190,7 @@ Array
190190
</screen>
191191
</example>
192192
<example>
193-
<title><function>array_filter</function> 不使用 <parameter>mode</parameter> 参数时</title>
193+
<title><function>array_filter</function> 使用 <parameter>mode</parameter> </title>
194194
<programlisting role="php">
195195
<![CDATA[
196196
<?php
@@ -237,9 +237,10 @@ array(2) {
237237
<para>
238238
<simplelist>
239239
<member><function>array_intersect</function></member>
240+
<member><function>array_find</function></member>
241+
<member><function>array_any</function></member>
240242
<member><function>array_map</function></member>
241243
<member><function>array_reduce</function></member>
242-
<member><function>array_walk</function></member>
243244
</simplelist>
244245
</para>
245246
</refsect1>

reference/array/functions/array-replace.xml

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: fea4357a0ced6a776a2db2ef0d4c09c39ad41ae1 Maintainer: daijie Status: ready -->
3+
<!-- EN-Revision: 5cc10e8d90a9d0cbb35779b60580e772e7d660a1 Maintainer: daijie Status: ready -->
4+
<!-- CREDITS: mowangjuanzi -->
45
<refentry xml:id="function.array-replace" xmlns="http://docbook.org/ns/docbook">
56
<refnamediv>
67
<refname>array_replace</refname>
@@ -14,10 +15,11 @@
1415
<methodparam rep="repeat"><type>array</type><parameter>replacements</parameter></methodparam>
1516
</methodsynopsis>
1617
<para>
17-
<function>array_replace</function> 函数使用后面数组元素相同 key 的值替换 <parameter>array</parameter> 数组的值。如果一个键存在于第一个数组同时也存在于第二个数组,它的值将被第二个数组中的值替换。如果一个键存在于第二个数组,但是不存在于第一个数组,则会在第一个数组中创建这个元素。如果一个键仅存在于第一个数组,它将保持不变。如果传递了多个替换数组,它们将被按顺序依次处理,后面的数组将覆盖之前的值。
18+
<function>array_replace</function> 创建新数组,并为提供的数组中的每个 key
19+
都分配元素。如果某个 key 出现在多个输入数组中,则将使用最右侧输入数组中的值。
1820
</para>
1921
<para>
20-
<function>array_replace</function> 是非递归的:它将第一个数组的值进行替换而不管第二个数组中是什么类型
22+
<function>array_replace</function> 不会递归处理元素项,它在替换时会替换每个 key 的值
2123
</para>
2224
</refsect1>
2325
<refsect1 role="parameters">
@@ -63,21 +65,59 @@ $replacements = array(0 => "pineapple", 4 => "cherry");
6365
$replacements2 = array(0 => "grape");
6466
6567
$basket = array_replace($base, $replacements, $replacements2);
66-
print_r($basket);
68+
var_dump($basket);
6769
?>
6870
]]>
6971
</programlisting>
7072
&example.outputs;
7173
<screen role="php">
7274
<![CDATA[
73-
Array
74-
(
75-
[0] => grape
76-
[1] => banana
77-
[2] => apple
78-
[3] => raspberry
79-
[4] => cherry
80-
)
75+
array(5) {
76+
[0]=>
77+
string(5) "grape"
78+
[1]=>
79+
string(6) "banana"
80+
[2]=>
81+
string(5) "apple"
82+
[3]=>
83+
string(9) "raspberry"
84+
[4]=>
85+
string(6) "cherry"
86+
}
87+
]]>
88+
</screen>
89+
</example>
90+
<example>
91+
<title>嵌套数组的处理方式示例</title>
92+
<programlisting role="php">
93+
<![CDATA[
94+
<?php
95+
$base = [ 'citrus' => [ 'orange', 'lemon' ], 'pome' => [ 'apple' ] ];
96+
$replacements = [ 'citrus' => [ 'grapefruit' ] ];
97+
$replacements2 = [ 'citrus' => [ 'kumquat', 'citron' ], 'pome' => [ 'loquat' ] ];
98+
99+
$basket = array_replace($base, $replacements, $replacements2);
100+
var_dump($basket);
101+
?>
102+
]]>
103+
</programlisting>
104+
&example.outputs;
105+
<screen role="php">
106+
<![CDATA[
107+
array(2) {
108+
["citrus"]=>
109+
array(2) {
110+
[0]=>
111+
string(7) "kumquat"
112+
[1]=>
113+
string(6) "citron"
114+
}
115+
["pome"]=>
116+
array(1) {
117+
[0]=>
118+
string(6) "loquat"
119+
}
120+
}
81121
]]>
82122
</screen>
83123
</example>

reference/array/functions/array.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: c6534cb59e785d4fc77f123602132da74b07ac2a Maintainer: HonestQiao Status: ready -->
3+
<!-- EN-Revision: e784ba3c905ef723c16eb9f90e181708a696523e Maintainer: HonestQiao Status: ready -->
4+
<!-- CREDITS: mowangjuanzi -->
45
<refentry xml:id="function.array" xmlns="http://docbook.org/ns/docbook">
56
<refnamediv>
67
<refname>array</refname>
@@ -15,7 +16,7 @@
1516
<methodparam rep="repeat"><type>mixed</type><parameter>values</parameter></methodparam>
1617
</methodsynopsis>
1718
<para>
18-
创建一个数组。关于数组是什么的信息请阅读<link linkend="language.types.array">数组</link>一节
19+
创建数组。关于数组是什么的信息请阅读<link linkend="language.types.array">数组类型</link>,还包含有关替代括号语法(<literal>[]</literal>)的详细信息
1920
</para>
2021
</refsect1>
2122
<refsect1 role="parameters">

reference/array/functions/list.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 43ac336818cb3a18011d9b6ba91514f3332eb46d Maintainer: daijie Status: ready -->
3+
<!-- EN-Revision: 75a5125c8b8bbe3006415bdcff531735c5701bd5 Maintainer: daijie Status: ready -->
44
<!-- CREDITS: mowangjuanzi -->
55
<refentry xml:id="function.list" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -24,8 +24,12 @@
2424
在 PHP 7.1.0 之前的版本,<function>list</function> 仅能用于数字索引的数组,并假定数字索引从 0 开始。
2525
</para>
2626
</note>
27-
</refsect1>
28-
<refsect1 role="parameters">
27+
<para>
28+
自 PHP 7.1.0 起,<function>list</function> 还可以包含指定的 key,从而允许使用非整数或非连续 key
29+
解构数组。有关数组解构的更多详细信息,请参阅<link linkend="language.types.array.syntax.destructuring">数组解构部分</link>。
30+
</para>
31+
</refsect1>
32+
<refsect1 role="parameters">
2933
&reftitle.parameters;
3034
<para>
3135
<variablelist>

reference/array/setup.xml

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)