Page 1 of 1

comparing an array to an array

Posted: Fri Jun 13, 2008 6:54 pm
by ibanez270dx
hello,
I have two arrays. My first array is $user_member_of = ["it_support","human_resources"] and my second is $file_posted_for = ["1","administration","human_resources","5","19"]. What I need to do is check if any of the values from my first array are in the second array. I used to use in_array(), but that was when $user_member_of was a string... it doesn't work with an array.

Any help is appreciated!!!

Thanks,
- Jeff

Re: comparing an array to an array

Posted: Fri Jun 13, 2008 6:57 pm
by VladSun

Re: comparing an array to an array

Posted: Fri Jun 13, 2008 7:12 pm
by ibanez270dx
EXACTLY what I was looking for! Thanks!!