Removing all instances of items from array

I have an array which may have duplicate values\[code\]$array1 = [value19, value16, value17, value16, value16]\[/code\]I'm looking for an efficient little PHP function that could accept either an array or a string (whichever makes it easier)\[code\]$array2 = ["value1", "value16", "value17"];or $string2 = "value1 value16 value17";\[/code\]and removes each item in array2 or string2 from array1. The right output for this example would be:\[code\]$array1 = [value19]\[/code\]For those more experienced with PHP, is something like this available in PHP?
 
Back
Top