hi
i have two arrays, one containing a list of all members, and another containing a list of the members to remove (from the first array).
is there a simple way to return elements of the first array that aren't in the second, i.e. the members that will be left after i have removed some.
this is how i've done it, but i feel this is too clumsy :
for($xx=0; $xx<count($contents); $xx++) { // all members
$found = false; // flag not set
for($qq=0; $qq<count($addresses); $qq++) { // ones to remove if($contents[$xx] == $addresses[$qq]) {
$found=true;
break;
} // end if
} // end for $qq
if(!$found) { $newlist[] = $contents[$xx];
} // end if
} // end for $xx
echo "New list : <br>";
for($e=0; $e<count($newlist); $e++) {
echo "$newlist[$e]<br>";
} // end for $e
any advice on improving the efficiency of this code would be most appreciated
cheers
rob