comparing an array to an array
Posted: Fri Jun 13, 2008 6:54 pm
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
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