Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CB9TOIIIA/8dd922cac2428f8a760712402945e05d to your computer and use it in GitHub Desktop.
Save CB9TOIIIA/8dd922cac2428f8a760712402945e05d to your computer and use it in GitHub Desktop.
Убрать дубли по ключу в многомерном массиве
$BigArAuto = array_replace_recursive($GetTagsAndCountTodayar,$bigarr);
$CountBigArAuto = count($BigArAuto);
function unique_multidim_array($array, $key) {
$temp_array = array();
$i = 0;
$key_array = array();
foreach($array as $val) {
if (!in_array($val[$key], $key_array)) {
$key_array[$i] = $val[$key];
$temp_array[$i] = $val;
}
$i++;
}
return $temp_array;
}
$details = unique_multidim_array($BigArAuto,'name');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment