Is there any function that does the inverse operation of array_diff()?
I mean, if i have:
array(1,2,3)
array(3,4,5)
I would like that function returns array(3), or directly 3.
Note: array_intersect() doesn’t fit me.
Javier
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If
array_intersect() doesn't fit meis because it returns:and not:
or
3Then you could easily transform the array to something workable with array_values():
Else please explain your situation.