Wednesday, April 29, 2009

Re: Comparing arrays

I *think* you're looking for array_diff_uassoc -- http://php.net/array_diff_uassoc

On Apr 29, 2:15 pm, Faza <f...@ansi.pl> wrote:
> Hi guys,
>
> I'm curious if there is a built-in method to get an array which is a
> result of comparing two other arrays with the same structure?
>
> Like
>
> $a = array('k1' => 'v1', 'k2' => 'v2', 'k3' => '')
> $b = array('k1' => '', 'k2' => 'v2', 'k3' => 'yo momma')
>
> comparison of the two would give
>
> $c = array('k1' => '', 'k3' => 'yo momma')
>
> If not, I'll try to write this up, but maybe there is a ready method for
> this.
>
> Regards,
> Jacek
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: