php-general | 2005051
Date: 05/06/05
- Next message: Mehdi Achour: "[PHP] Re: php.ini uploads"
- Previous message: Jon Aston: "[PHP] php.ini uploads"
- Next in thread: pete M: "[PHP] Re: array diff with both values returned"
- Reply: pete M: "[PHP] Re: array diff with both values returned"
- Reply: Philip Hallstrom: "Re: [PHP] array diff with both values returned"
- Reply: Richard Lynch: "Re: [PHP] array diff with both values returned"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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!
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Mehdi Achour: "[PHP] Re: php.ini uploads"
- Previous message: Jon Aston: "[PHP] php.ini uploads"
- Next in thread: pete M: "[PHP] Re: array diff with both values returned"
- Reply: pete M: "[PHP] Re: array diff with both values returned"
- Reply: Philip Hallstrom: "Re: [PHP] array diff with both values returned"
- Reply: Richard Lynch: "Re: [PHP] array diff with both values returned"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

