PHP: Check for duplicate values in a multidimensional array -
i have issue multidimensional arrays.
given following multidimensional array:
array( [0] => array("a", "b", "c") [1] => array("x", "y", "z") [2] => array("a", "b", "c") [3] => array("a", "b", "c") [4] => array("a", "x", "z") )
i want check values , find duplicates (i.e. keys 0, 2 , 3) leaving 1 key - value pair deleting others, resulting in somthing this:
array( [0] => array("a", "b", "c") [1] => array("x", "y", "z") [2] => array("a", "x", "z") )
how can that??
this remove duplicate items array using array_unique()
:
$new_arr = array_unique($arr, sort_regular);
Comments
Post a Comment