compare two arrays and return the difference php
array_merge(array_diff($array1,$array2),array_diff($array2,$array1))
compare two arrays and return the difference php
array_merge(array_diff($array1,$array2),array_diff($array2,$array1))
assocititive multi array compare php
NOTE: the diff_array also removes all the duplicate values that match to the values in the second array:
<?php
$array1 = array("a","b","c","a","a");
$array2 = array("a");
$diff = array_diff($array1,$array2);
// yields: array("b","c") the duplicate "a" values are removed
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us