Would running array_diff_assoc() twice on an array give me all non-unique entries?
$array3 = array_diff_assoc($array1, $array2);
$array4 = array_diff_assoc($array1, $array3);
var_dump($array4);
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.
Given:
$array1, and$array2,B would be composed of:
$array3,diff_assoc_array($array1, $array2), would be the operation A \ B, which would reduces as follows:$array4,diff_assoc_array($array1, $array3), would be the operation A \ (A ∩ ¬B’), which reduces as follows:Therefore yes, the final result would be the items common to both arrays.