hi there, i have an array with a splited product name, like Mac Allen 15 years old in array1. array 2 may contain some "general" words like old year years so is there any smart function to remove all words in array2 from array 1, so that array1 has only "Mac Allan 15" left?
you can use <?php $arr1 = array("one", "two", "three"); $arr2 = array("one", "three"); foreach ($arr2 as $value) { unset($arr1[array_search($value,$arr1)]); } ?> Code (markup):
ah great, i already came along this array_diff functions before i made this posting, but somehow i overlooked this one