|
Posted by Gerard Matthew on 11/17/05 16:18
What i need to do is compare two arrays and return an array that only
has those that are not in the main table.It's similar to what you could
do with SQL.
Array 1 - List of Everything
Array 2 - List of Some of Array 1
What i want to obtain is Those of Array 1 that are not in Array 2. I
would prefer not to do the following:
function getUnique($array1, $array2) {
foreach ($array1, $key => $value) {
$array2_key = array_search($array2,$value)
if ($array2_key === false)
$result_array[] = $value;
}
return $result_array;
}
Is there any simplier way of doing this...any predefined function in
php that could do this??
Regards,
Gerard Matthew.
Navigation:
[Reply to this message]
|