Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.www.php > #20200
| From | bramante <bramante@yopmail.com> |
|---|---|
| Newsgroups | it.comp.www.php |
| Subject | Re: aggiungere solo i nuovi elementi ad un array |
| Date | 2016-01-11 23:39 +0100 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <n71b0h$npj$1@gioia.aioe.org> (permalink) |
| References | <n702eb$mud$1@gioia.aioe.org> <n704j1$veb$1@gioia.aioe.org> <2016011115423321669@mynewsgate.net> <n70l2g$qai$1@gioia.aioe.org> |
Il 11/01/2016 17:25, alex ha scritto:
> Il 11/01/2016 16:42, ciccio ha scritto:
>> alex <1j9448a02@lnx159sneakemail.com.invalid> ha scritto:
>>
>> CUT
>>>> Ma non è che esiste una funzione php nativa (già pronta) per fare
>>>> quanto
>>>> illustrato?
>>>
>>> forse basta solo
>>>
>>> return $arr1 + $arr2;
>>>
>>> possibile che sia così semplice, o mi sfugge qualcosa?
>>> o_O
>>
>> Si può fare anche tramite funzioni native:
>>
>> array_unique(array_merge($a, $b));
>>
>>
>
> print_r(array_unique(array_merge(
> array(0),
> array(1,2)
> )));
>
> l'elemento *[1] => 1* non ci dovrebbe essere però
>
> Array
> (
> [0] => 0
> [1] => 1
> [2] => 2
> )
>
> cioè si dovrebbe avere
>
> Array
> (
> [0] => 0
> [1] => 2
> )
>
prova
print_r(array_unique(array_merge(
array('0'=>'0'),
array('1'=>'2')
)));
Ciao
Back to it.comp.www.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
aggiungere solo i nuovi elementi ad un array alex <1j9448a02@lnx159sneakemail.com.invalid> - 2016-01-11 12:07 +0100
Re: aggiungere solo i nuovi elementi ad un array alex <1j9448a02@lnx159sneakemail.com.invalid> - 2016-01-11 12:44 +0100
Re: aggiungere solo i nuovi elementi ad un array "ciccio" <21669invalid@mynewsgate.net> - 2016-01-11 15:42 +0000
Re: aggiungere solo i nuovi elementi ad un array alex <1j9448a02@lnx159sneakemail.com.invalid> - 2016-01-11 17:25 +0100
Re: aggiungere solo i nuovi elementi ad un array bramante <bramante@yopmail.com> - 2016-01-11 23:39 +0100
Re: aggiungere solo i nuovi elementi ad un array alex <1j9448a02@lnx159sneakemail.com.invalid> - 2016-01-12 09:02 +0100
Re: aggiungere solo i nuovi elementi ad un array Leonardo Serni <lserni@gmail.com> - 2016-01-14 14:13 +0100
Re: aggiungere solo i nuovi elementi ad un array alex <1j9448a02@lnx159sneakemail.com.invalid> - 2016-01-17 10:43 +0100
Re: aggiungere solo i nuovi elementi ad un array Leonardo Serni <lserni@gmail.com> - 2016-01-17 18:38 +0100
Re: aggiungere solo i nuovi elementi ad un array alex <1j9448a02@lnx159sneakemail.com.invalid> - 2016-01-18 10:51 +0100
csiph-web