아침 프로젝트에서 작업하고 있는데 배열 객체에서 중복 항목을 제거하는 방법을 알고 있습니다. 여기배열 객체에서 중복 항목을 제거하는 방법
내 배열의 구조 : 여기
"IDGROUP": [
{
"id": 72
},
{
"id": 72
}
]
은 코드입니다 : 당신의 도움에 대한
if($compteGroupes && $compteGroupes->getId()!=0){
$Tableaux_pack[$current_id_fictif]["ingroup"]]=
$Mes_comptes_reels_dependants [$taille_reel];
$Tableaux_pack[$current_id_fictif]["IDGROUP"]=
array(
'id'=>$compteGroupes->getId()
);
}
감사의
[PHP의 배열에서 중복 값을 제거하는 방법] 가능한 복제본 (https://stackoverflow.com/questions/307650/how-to-remove-duplicate-values-from-an- array-in-php) – amicoderozer
array_unique()를 사용할 때 여전히 문제가 발생합니다 –
내 목표는이 배열에서 루프 할 때 같은 속성 값을 공유하는 객체의 중복을 제거하는 것입니다 –