title: How can use array_unique function in stdClass Object Array PHP
body: <p>Im trying to get a unique array but I can't, because I am working with a stdClass Object. My object is named <code>$items</code> and it has duplicate values. Some part of it is below.</p>
  
  <p>How can we do unique array this with php?</p>
  
  <pre><code>Array ( [0] =&gt; stdClass Object ( [product_id] =&gt; 93 [model] =&gt; VNA452E1 [sku] =&gt; [upc] =&gt; [ean] =&gt; [jan] =&gt; [isbn] =&gt; [mpn] =&gt; [location] =&gt; [quantity] =&gt; 1 [stock_status_id] =&gt; 5 [image] =&gt; data/1NI_FD_245430_VNA453E1_4_Particolari_BIG.jpg [manufacturer_id] =&gt; 0 [shipping] =&gt; 1 [price] =&gt; 140.0000 [points] =&gt; 0 [tax_class_id] =&gt; 0 [date_available] =&gt; 2014-07-22 [weight] =&gt; 0.00000000 [weight_class_id] =&gt; 1 [length] =&gt; 0.00000000 [width] =&gt; 0.00000000 [height] =&gt; 0.00000000 [length_class_id] =&gt; 1 [subtract] =&gt; 1 [minimum] =&gt; 1 [sort_order] =&gt; 1 [status] =&gt; 1 [date_added] =&gt; 2014-07-23 16:14:26 [date_modified] =&gt; 2014-07-23 16:54:52 [viewed] =&gt; 9 [language_id] =&gt; 2 [name] =&gt; NIKON COOLPIX S02 [description] =&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;SENSORE&lt;/b&gt;:CMOS, 1/3.1, Megapixel Reali : 14,17 , Megapixel Effettivi : 13,20 ; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;OBIETTIVO&lt;/b&gt;: Zoom Ottico : 3 x, Zoom Digitale : 4 x, Apertura Max alla Focale Min : 3,30 F, Apertura Max alla Focale Max : 5,90 F; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;DISPLAY&lt;/b&gt;:2,63 inches; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;OTTURATORE&lt;/b&gt;:1, 1/2000; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;MEMORIA&lt;/b&gt;:7300 mb; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;REGISTRAZIONE&lt;/b&gt;:Risoluzione Max Immagine Foto (Larghezza) : 4160 , Risoluzione Max Immagine Foto &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;(Altezza) : 3120 , Registrazione HD; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;CONNESSIONI&lt;/b&gt;:Connessione HDMI; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;ALTRE CARATTERISTICHE&lt;/b&gt;:Microfono Incorporato, Adattabilità Treppiedi Standard; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;PESI E MISURE&lt;/b&gt;:Altezza : 5,13 cm, Larghezza : 7,71 cm, Profondità : 1,75 cm, 100 g; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;GARANZIA&lt;/b&gt;: 24 mesi.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; [meta_description] =&gt; [meta_keyword] =&gt; NIKON COOLPIX S02 [tag] =&gt; [category_name] =&gt; Cameras [category_id] =&gt; 33 ) 
  
  [1] =&gt; stdClass Object ( [product_id] =&gt; 93 [model] =&gt; VNA452E1 [sku] =&gt; [upc] =&gt; [ean] =&gt; [jan] =&gt; [isbn] =&gt; [mpn] =&gt; [location] =&gt; [quantity] =&gt; 1 [stock_status_id] =&gt; 5 [image] =&gt; data/1NI_FD_245430_VNA453E1_4_Particolari_BIG.jpg [manufacturer_id] =&gt; 0 [shipping] =&gt; 1 [price] =&gt; 140.0000 [points] =&gt; 0 [tax_class_id] =&gt; 0 [date_available] =&gt; 2014-07-22 [weight] =&gt; 0.00000000 [weight_class_id] =&gt; 1 [length] =&gt; 0.00000000 [width] =&gt; 0.00000000 [height] =&gt; 0.00000000 [length_class_id] =&gt; 1 [subtract] =&gt; 1 [minimum] =&gt; 1 [sort_order] =&gt; 1 [status] =&gt; 1 [date_added] =&gt; 2014-07-23 16:14:26 [date_modified] =&gt; 2014-07-23 16:54:52 [viewed] =&gt; 9 [language_id] =&gt; 2 [name] =&gt; NIKON COOLPIX S02 [description] =&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;SENSORE&lt;/b&gt;:CMOS, 1/3.1, Megapixel Reali : 14,17 , Megapixel Effettivi : 13,20 ; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;OBIETTIVO&lt;/b&gt;: Zoom Ottico : 3 x, Zoom Digitale : 4 x, Apertura Max alla Focale Min : 3,30 F, Apertura Max alla Focale Max : 5,90 F; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;DISPLAY&lt;/b&gt;:2,63 inches; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;OTTURATORE&lt;/b&gt;:1, 1/2000; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;MEMORIA&lt;/b&gt;:7300 mb; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;REGISTRAZIONE&lt;/b&gt;:Risoluzione Max Immagine Foto (Larghezza) : 4160 , Risoluzione Max Immagine Foto &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;(Altezza) : 3120 , Registrazione HD; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;CONNESSIONI&lt;/b&gt;:Connessione HDMI; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;ALTRE CARATTERISTICHE&lt;/b&gt;:Microfono Incorporato, Adattabilità Treppiedi Standard; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;PESI E MISURE&lt;/b&gt;:Altezza : 5,13 cm, Larghezza : 7,71 cm, Profondità : 1,75 cm, 100 g; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 12pt;"&gt;&lt;b&gt;GARANZIA&lt;/b&gt;: 24 mesi.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; [meta_description] =&gt; [meta_keyword] =&gt; NIKON COOLPIX S02 [tag] =&gt; [category_name] =&gt; Fotocamere [category_id] =&gt; 33 ) [2] =&gt; stdClass Object ( [product_id] =&gt; 92 [model] =&gt; 1FA6_002 [sku] =&gt; [upc] =&gt; [ean] =&gt; [jan] =&gt; [isbn] =&gt; [mpn] =&gt; [location] =&gt; [quantity] =&gt; 1 [stock_status_id] =&gt; 5 [image] =&gt; data/TOM_RG_216169_1FA4_002_02.jpg [manufacturer_id] =&gt; 0 [shipping] =&gt; 1 [price] =&gt; 259.0000 [points] =&gt; 0 [tax_class_id] =&gt; 0 [date_available] =&gt; 2014-07-22 [weight] =&gt; 0.00000000 [weight_class_id] =&gt; 1 [length] =&gt; 0.00000000 [width] =&gt; 0.00000000 [height] =&gt; 0.00000000 [length_class_id] =&gt; 1 [subtract] =&gt; 1 [minimum] =&gt; 1 [sort_order] =&gt; 1 [status] =&gt; 1 [date_added] =&gt; 2014-07-23 15:55:05 [date_modified] =&gt; 2014-07-23 15:58:36 [viewed] =&gt; 7 [language_id] =&gt; 2 [name] =&gt; TOM TOM GO 600 [description] =&gt; &lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;b&gt;SISTEMA GPS&lt;/b&gt;:Auto; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;b&gt;CARATTERISTICHE GENERALI&lt;/b&gt;:Tom Tom, Italia, Austria - Svizzera - Germania, Francia, &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 14pt;"&gt;Penisola Iberica, Regno Unito, Scandinavia, Paesi Est, Russia, Grecia, Major Roads Europe; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;b&gt;SCHERMO&lt;/b&gt;: 6 "Retroilluminazione, Visualizzazione 3D, 480 Pixels, Risoluzione Verticale 272, &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 14pt;"&gt;Touchscreen; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;b&gt;ESPANSIONE / CONNETTIVITÀ&lt;/b&gt;:Canali : 12 , POI; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;b&gt;CONNETTIVITÀ&lt;/b&gt;:Bluetooth;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 14pt;"&gt; &lt;b&gt;BATTERIA&lt;/b&gt;:120 min; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 14pt;"&gt;&lt;b&gt;GARANZIA&lt;/b&gt;: 24 mesi.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; [meta_description] =&gt; [meta_keyword] =&gt; TOM TOM GO 600 [tag] =&gt; [category_name] =&gt; Navigatori Satellitari [category_id] =&gt; 53 )
  </code></pre>