You are here: Re: array diff with both values returned « PHP « IT news, forums, messages
Re: array diff with both values returned

Posted by pete M on 10/12/56 11:15

http://uk2.php.net/manual/en/function.array-diff.php
http://uk2.php.net/manual/en/function.array-diff-assoc.php


Blackwater Dev wrote:
> Hello,
>
> Is there a good way to get the difference in two arrays and have both
> values returned? I know I can use array_dif to see what is in one and
> not the other but...I need it to work a bit differently.
>
> I have:
>
> $array1=array("name"=>"fred","gender"=>"m","phone="=>"555-5555");
> $array2=array("name"=>"fred","gender"=>"f","phone="=>"555-5555");
>
> I want to compare these two and have it return:
>
> array("gender"=>array("m","f"));
>
> I want it to return all of the differences with the key and then the
> value from array 1 and 2.
>
> How?
>
> Thanks!

 

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

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