cvs: /phpdoc/functions array.sgml
| From: | Andrey Zmievski | Date: | Fri, 16 Jul 1999 18:28:56 +0000 |
| Subject: | cvs: /phpdoc/functions array.sgml | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-8632@lists.php.net to get a copy of this message | ||
andrey Fri Jul 16 18:28:56 1999 EDT
Modified files:
/phpdoc/functions array.sgml
Log:
Documented array_merge. Only compact is left now.
Index: phpdoc/functions/array.sgml
diff -u phpdoc/functions/array.sgml:1.12 phpdoc/functions/array.sgml:1.13
--- phpdoc/functions/array.sgml:1.12 Fri Jul 16 17:48:10 1999
+++ phpdoc/functions/array.sgml Fri Jul 16 18:28:56 1999
@@ -376,6 +376,44 @@
</refsect1>
</refentry>
+ <refentry id="function.array-merge">
+ <refnamediv>
+ <refname>array_merge</refname>
+ <refpurpose>Merge two or more arrays</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>array <function>array_merge</function></funcdef>
+ <paramdef>array <parameter>array1</parameter></paramdef>
+ <paramdef>array <parameter>array2</parameter></paramdef>
+ <paramdef>
+ <parameter><optional> ...</optional></parameter>
+ </paramdef>
+ </funcsynopsis>
+
+ <para>
+ <function>array_merge</function> merges the elements of two or
+ more arrays together so that the values of one are appended to
+ the end of the previous one. It returns the resulting array.
+
+ <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.
+
+ <para>
+ <example>
+ <title><function>array_merge</function> example</title>
+ <programlisting>
+$array1 = array("color" => "red", 2, 4);
+$array2 = array("a", "b", "color" => "green",
"shape" => "trapezoid");
+array_merge($array1, $array2);
+ </programlisting>
+
+ Resulting array will be array("color" => "green", 2, 4, "a",
"b", "shape" => "trapezoid").
+ </example>
+ </refsect1>
+ </refentry>
+
<refentry id="function.array-keys">
<refnamediv>
<refname>array_keys</refname>
@@ -875,7 +913,7 @@
<refentry id="function.in-array">
<refnamediv>
<refname>in_array</refname>
- <refpurpose>Check if a value exists in an array</refpurpose>
+ <refpurpose>Return true if a value exists in an array</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>