I want to compare 2 arrays by values and not keys. For example:
$array1 = array(0 => 'wow', 1 => 'foo', 2 => 'bar');
$array2 = array(0 => 'foo', 1 => 'wow', 2 => 'bar');
are not unique.
Is there any function for this?
Thanx!
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.
array_diff() – Compares array1 against array2 and returns the difference.
array_diff_assoc() – Computes the difference of arrays with additional index check