You are here: Re: [PHP] Re: problem with array diff, need to reindex array according to key « PHP « IT news, forums, messages
Re: [PHP] Re: problem with array diff, need to reindex array according to key

Posted by Angelo Zanetti on 10/06/35 11:14

sorry I'm not using array_diff_assoc just array_diff...

Jason Barnett wrote:

> Angelo Zanetti wrote:
>
>> HI all,
>>
>> I am using the array_diff function.
>> The problem im having is the array that gets returned. Well here's an
>> example:
>>
>> this is where i assign the values to two different arrays
>>
>> $a[]="0";
>> $a[]="1";
>> $a[]="2";
>> $a[]="3";
>>
>>
>> $b[]="1";
>> $b[]="4";
>> $b[]="0";
>>
>>
>> $diff = array_diff_assoc($a, $b);
>>
>
> /* Get the diff of the arrays, but re-index to 0 */
> $diff = array_values(array_diff_assoc($a, $b));
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация