Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

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
15 views



Related Hot Questions



Government Jobs Opening


...