1
0
mirror of https://github.com/php/doc-it.git synced 2026-03-26 08:32:15 +01:00
Files
archived-doc-it/reference/array/functions/array-merge-recursive.xml
Marco Cucinato 00cc4dd850 updated revision
git-svn-id: https://svn.php.net/repository/phpdoc/it/trunk@82040 c90b9560-bf6c-de11-be94-00142212c4b1
2002-05-12 22:14:11 +00:00

93 lines
2.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- splitted from ./it/functions/array.xml, last change in rev 1.6 -->
<!-- last change to 'array-merge-recursive' in en/ tree in rev 1.12 -->
<!-- EN-Revision: 1.4 Maintainer: cucinato Status: ready -->
<!-- OLD-Revision: 1.173/EN.1.12 -->
<refentry id="function.array-merge-recursive">
<refnamediv>
<refname>array_merge_recursive</refname>
<refpurpose>Fonde due o pi&ugrave; array in modo ricorsivo</refpurpose>
</refnamediv>
<refsect1>
<title>Descrizione</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> fonde gli elementi di
due o pi&ugrave; array in modo tale che i valori di un array siano accodati
all'array precedente. Restituisce l'array risultante.
</para>
<para>
Se gli array in input hanno le stesse chiavi stringa, i valori di
queste chiavi vengono fusi in un array, e questo &egrave; fatto in modo
ricorsivo, cio&grave; se uno dei valori &egrave; un array, la
funzione lo fonder%agrave; con una voce corrispondente in un altro array
Comunque, se gli array hanno la stessa chiave numerica, l'ultimo valore
non sovrascriver&grave; il valore originale, bens&igrave; verr&agrave; accodato.
</para>
<para>
<example>
<title>Esempio di <function>array_merge_recursive</function></title>
<programlisting role="php">
<![CDATA[
$ar1 = array ("colore" => array ("preferito" => "rosso"), 5);
$ar2 = array (10, "colore" => array ("preferito" => "verde", "blu"));
$risultato = array_merge_recursive ($ar1, $ar2);
]]>
</programlisting>
<para>
La variabile <varname>$risultato</varname> sarà:
<screen role="php">
<![CDATA[
Array
(
[colore] => Array
(
[preferito] => Array
(
[0] => rosso
[1] => verde
)
[0] => blu
)
[0] => 5
[1] => 10
)
]]>
</screen>
</para>
</example>
</para>
<para>
Vedere anche <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
-->