Get the real difference between two arrays in php

acuellarj

New Member
I'm trying to get the difference between two arrays, but with \[code\]array_diff\[/code\], \[code\]array_diff_assoc\[/code\], or \[code\]array_diff_key\[/code\] I can't get what I want..\[code\]Array 1 : 0 => 424012, 1 => 423000, 2 => 425010, 3 => 431447, 4 => 421001, 5 => 421002,Array 2 : 0 => 424012, 1 => 423000, 2 => 425010, 3 => 431447, 4 => 431447, 5 => 421001, 6 => 421002,array_diff = array () // emptyjarray_diff_assoc = array ( 4 => 431447, 5 => 421001, 6 => 421002,) // OK but too much :)array_diff_key = array(6 => 421002) // nope i don't want that :(\[/code\]I want 431447, cause it's only one time in the first array and twice in the second.Regards, Tony
 
Back
Top