Organizational Research By

Surprising Reserch Topic

Question:how to removes all the duplicate values that match to the values in the second array


    $array1 = array("a","b","c","a","a"); 
    $array2 = array("a"); 
    $diff = array_diff($array1,$array2); 
    // yields: array("b","c") the duplicate "a" values are removed 

asked Sep 13, 2013 in PHP by ashish singh
edited Sep 12, 2013
0 votes

Related Hot Questions

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.