去除数组中的重复元素

function uniqueByChild($array, $child){

 $child = "['" . implode("']['", explode(',', $child)) . "']";
 $buffer = array();
 foreach ($array as $index => $value){
  eval("/$check = /$value{$child};");
  if ( in_array($check, $buffer) ){
    unset($array[$index]);
  }
  else{
    $buffer[] = $check;
  }
 }
 return $array;
}

你可能感兴趣的:(function,buffer)