0
上午我正在开发一个项目,我有一个问题,它即将知道如何从数组对象中删除重复条目。如何从阵列对象中删除重复条目
这里是我的阵列的结构:
"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()时,问题仍然存在 –
我的目标是当我在这个数组上循环时删除共享相同属性值的对象的重复项 –