1
2NOTE: the diff_array also removes all the duplicate values that match to the values in the second array:
3
4
5
6<?php
7
8 $array1 = array("a","b","c","a","a");
9
10 $array2 = array("a");
11
12
13
14 $diff = array_diff($array1,$array2);
15
16
17
18 // yields: array("b","c") the duplicate "a" values are removed
19
20?>
21
22