reference/array/functions/array-diff-assoc.xml
6b64170daac5587bee4bb63c0020cb2fbf7f1253
...
...
@@ -55,6 +55,25 @@
55
55
</para>
56
56
</refsect1>
57
57

58
+
<refsect1 role="changelog">
59
+
&reftitle.changelog;
60
+
<para>
61
+
<informaltable>
62
+
<tgroup cols="2">
63
+
<thead>
64
+
<row>
65
+
<entry>&Version;</entry>
66
+
<entry>&Description;</entry>
67
+
</row>
68
+
</thead>
69
+
<tbody>
70
+
&array.changelog.require-only-one;
71
+
</tbody>
72
+
</tgroup>
73
+
</informaltable>
74
+
</para>
75
+
</refsect1>
76
+

58
77
<!--
59
78
<refsect1 role="errors">
60
79
&reftitle.errors;
...
...
@@ -68,11 +87,13 @@
68
87
<example>
69
88
<title><function>array_diff_assoc</function> example</title>
70
89
<para>
71
-
In this example you see the <literal>"a" =&gt; "green"</literal>
90
+
In this example the <literal>"a" =&gt; "green"</literal>
72
91
pair is present in both arrays and thus it is not in the output from the
73
92
function. Unlike this, the pair <literal>0 =&gt; "red"</literal>
74
-
is in the output because in the second argument <literal>"red"</literal>
75
-
has key which is <literal>1</literal>.
93
+
is in the output because the key of <literal>"red"</literal> is
94
+
automatically assigned to <literal>0</literal> in the first array,
95
+
whereas it is assigned to <literal>1</literal> in the second array as the
96
+
key <literal>0</literal> is already taken by <literal>yellow</literal>.
76
97
</para>
77
98
<programlisting role="php">
78
99
<![CDATA[
...
...
@@ -123,7 +144,7 @@ Array
123
144
(
124
145
[0] => 0
125
146
[1] => 1
126
-
)
147
+
)
127
148
]]>
128
149
</screen>
129
150
</example>
...
...
@@ -134,14 +155,14 @@ Array
134
155
&reftitle.notes;
135
156
<note>
136
157
<simpara>
137
-
This function only checks one dimension of a n-dimensional
138
-
array. Of course you can check deeper dimensions by using, for example,
158
+
This function only checks one dimension of an n-dimensional
159
+
array. It is possible to check deeper dimensions by using, for example,
139
160
<literal>array_diff_assoc($array1[0], $array2[0]);</literal>.
140
161
</simpara>
141
162
</note>
142
163
<note>
143
164
<simpara>
144
-
Ensure you pass arguments in the correct order when comparing similar
165
+
Ensure arguments are passed in the correct order when comparing similar
145
166
arrays with more keys. The new array should be the first in the list.
146
167
</simpara>
147
168
</note>
148
169