mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
clarified the description and fixed some grammatical errors; clarified the code example concerning numeric indexes
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@27446 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
251c6a3eea
commit
018b3e8f5a
1 changed files with 6 additions and 6 deletions
|
@ -190,22 +190,22 @@ array_keys ($array, 100); // returns array (0, 2)
|
|||
the end of the previous one. It returns the resulting array.
|
||||
</para>
|
||||
<para>
|
||||
If the input arrays had the same string keys, then the later
|
||||
value for that key will overwrite previous one. If, however, the
|
||||
arrays have the same numeric key, this does not happen since the
|
||||
values are appended.
|
||||
If the input arrays have the same string keys, then the later
|
||||
value for that key will overwrite the previous one. If, however,
|
||||
the arrays have the same numeric key, the later value will not
|
||||
overwrite the original value, but will be appended.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>array_merge</function> example</title>
|
||||
<programlisting role="php">
|
||||
$array1 = array ("color" => "red", 2, 4);
|
||||
$array2 = array ("a", "b", "color" => "green", "shape" => "trapezoid");
|
||||
$array2 = array ("a", "b", "color" => "green", "shape" => "trapezoid", 4);
|
||||
array_merge ($array1, $array2);
|
||||
</programlisting>
|
||||
<para>
|
||||
Resulting array will be array("color" => "green", 2, 4, "a",
|
||||
"b", "shape" => "trapezoid").
|
||||
"b", "shape" => "trapezoid", 4).
|
||||
</para>
|
||||
</example>
|
||||
<note>
|
||||
|
|
Loading…
Reference in a new issue