0

Morning I'm working on a project and I have a issue, it's about to know how to remove duplicate entry from an array object .

Here is structure of my array :

"IDGROUP": [
                {
                    "id": 72
                },
                {
                    "id": 72
                }
            ]

Here is code snippet:

 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()      
                                 );

                            }

thank's for your help

Troyer
  • 6,765
  • 3
  • 34
  • 62

1 Answers1

0

Your object looks like a javascript object - what do you actually mean?

are the entries classes? are they arrays

do you want to filter nested/multidimensional arrays based on their values?

do you want to filter different class objects? see here: https://stackoverflow.com/a/2426579/8548024

Pascal
  • 113
  • 9
  • when I loop on this array $Tableaux_pack[$current_id_fictif]["IDGROUP"] I need check if value $compteGroupes->getId() is allready inside before adding it – kadal sparkadal Sep 12 '17 at 08:39