Files
php-doc-ru/reference/array/functions/array-merge-recursive.xml
Hannes Magnusson 245266cba8 Upgrade to DocBook5:
- All id attributes are now xml:id
 - Add docbook namespace to all root elements
 - Replace <ulink /> with <link xlink:href />
 - Minor markup fixes here and there
 - Bump EN-Revision where appropriate


git-svn-id: https://svn.php.net/repository/phpdoc/ru/trunk@238337 c90b9560-bf6c-de11-be94-00142212c4b1
2007-06-23 13:31:28 +00:00

94 lines
3.4 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 1.4 Maintainer: tronic Status: ready -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/array.xml, last change in rev 1.12 -->
<refentry xml:id="function.array-merge-recursive" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>array_merge_recursive</refname>
<refpurpose>Рекурсивно слить два или большее количество массивов</refpurpose>
</refnamediv>
<refsect1>
<title>Описание</title>
<methodsynopsis>
<type>array</type><methodname>array_merge_recursive</methodname>
<methodparam><type>array</type><parameter>array1</parameter></methodparam>
<methodparam><type>array</type><parameter>array2</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>...</parameter></methodparam>
</methodsynopsis>
<para>
Функция <function>array_merge_recursive</function> сливает элементы
двух или большего количества массивов таким образом, что
значения одного массива присоединяются к значениям предыдущего.
Результатом работы функции является новый массив.
</para>
<para>
Если входные массивы имеют одинаковые строковые ключи, тогда
значения, соответствующие этим ключам, рекурсивно сливаются
в один массив, таким образом, если одно из значений является
массивом, функция сливает его с соответствующим значением
в другом массиве. Однако, если массивы имеют одинаковые
числовые ключи, значение, упомянутое последним, не заменит
исходное значение, а будет слито с ним.
</para>
<para>
<example>
<title>Пример использования <function>array_merge_recursive</function></title>
<programlisting role="php">
<![CDATA[
$ar1 = array ("color" => array ("favorite" => "red"), 5);
$ar2 = array (10, "color" => array ("favorite" => "green", "blue"));
$result = array_merge_recursive ($ar1, $ar2);
]]>
</programlisting>
<para>
Переменная <literal>$result</literal> будет содержать:
<screen role="php">
<![CDATA[
Array
(
[color] => Array
(
[favorite] => Array
(
[0] => red
[1] => green
)
[0] => blue
)
[0] => 5
[1] => 10
)
]]>
</screen>
</para>
</example>
</para>
<para>
См.также <function>array_merge</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->