There is an array with obekatmi (goods from the database):
array(10) { [0]=> object(stdClass)#37 (6) { ["id"]=> string(5) "31739" ["pro_title"]=> string(48) "ΠΠ»ΡΠ·Π° Ρ Π΄Π΅ΠΊΠΎΡΠΎΠΌ ΠΈΠ· ΠΏΠ°ΠΉΠ΅ΡΠΎΠΊ" ["price"]=> string(9) "154100.00" ["parent_id"]=> string(5) "31739" ["photo_id"]=> string(6) "116489" ["value"]=> string(7) "Rodarte" } [1]=> object(stdClass)#38 (6) { ["id"]=> string(5) "31739" ["pro_title"]=> string(48) "ΠΠ»ΡΠ·Π° Ρ Π΄Π΅ΠΊΠΎΡΠΎΠΌ ΠΈΠ· ΠΏΠ°ΠΉΠ΅ΡΠΎΠΊ" ["price"]=> string(9) "154100.00" ["parent_id"]=> string(5) "31739" ["photo_id"]=> string(6) "116489" ["value"]=> string(7) "Rodarte" } [2]=> object(stdClass)#39 (6) { ["id"]=> string(5) "31739" ["pro_title"]=> string(48) "ΠΠ»ΡΠ·Π° Ρ Π΄Π΅ΠΊΠΎΡΠΎΠΌ ΠΈΠ· ΠΏΠ°ΠΉΠ΅ΡΠΎΠΊ" ["price"]=> string(9) "154100.00" ["parent_id"]=> string(5) "31739" ["photo_id"]=> string(6) "116489" ["value"]=> string(7) "Rodarte" } [3]=> object(stdClass)#40 (6) { ["id"]=> string(5) "31762" ["pro_title"]=> string(30) "Π‘Π²ΠΈΡΠ΅Ρ ΠΈΠ· ΡΠ΅ΡΡΡΠΈ" ["price"]=> string(8) "39370.00" ["parent_id"]=> string(5) "31762" ["photo_id"]=> string(6) "116609" ["value"]=> string(5) "MONSE" } [4]=> object(stdClass)#41 (6) { ["id"]=> string(5) "31762" ["pro_title"]=> string(30) "Π‘Π²ΠΈΡΠ΅Ρ ΠΈΠ· ΡΠ΅ΡΡΡΠΈ" ["price"]=> string(8) "39370.00" ["parent_id"]=> string(5) "31762" ["photo_id"]=> string(6) "116609" ["value"]=> string(5) "MONSE" } [5]=> object(stdClass)#42 (6) { ["id"]=> string(5) "31762" ["pro_title"]=> string(30) "Π‘Π²ΠΈΡΠ΅Ρ ΠΈΠ· ΡΠ΅ΡΡΡΠΈ" ["price"]=> string(8) "39370.00" ["parent_id"]=> string(5) "31762" ["photo_id"]=> string(6) "116609" ["value"]=> string(5) "MONSE" } [6]=> object(stdClass)#43 (6) { ["id"]=> string(5) "31762" ["pro_title"]=> string(30) "Π‘Π²ΠΈΡΠ΅Ρ ΠΈΠ· ΡΠ΅ΡΡΡΠΈ" ["price"]=> string(8) "39370.00" ["parent_id"]=> string(5) "31762" ["photo_id"]=> string(6) "116609" ["value"]=> string(5) "MONSE" } [7]=> object(stdClass)#44 (6) { ["id"]=> string(5) "31765" ["pro_title"]=> string(25) "Π‘Π΅ΡΡΠ³ΠΈ Gold Baroque" ["price"]=> string(8) "50710.00" ["parent_id"]=> string(5) "31765" ["photo_id"]=> string(6) "116492" ["value"]=> string(7) "Rodarte" } [8]=> object(stdClass)#45 (6) { ["id"]=> string(5) "31768" ["pro_title"]=> string(40) "Π’ΠΎΠΏ ΠΈΠ· Π²ΠΈΡΠΊΠΎΠ·Ρ ΠΈ ΡΠ΅Π»ΠΊΠ°" ["price"]=> string(8) "90970.00" ["parent_id"]=> string(5) "31768" ["photo_id"]=> string(6) "116490" ["value"]=> string(7) "Rodarte" } [9]=> object(stdClass)#46 (6) { ["id"]=> string(5) "31768" ["pro_title"]=> string(40) "Π’ΠΎΠΏ ΠΈΠ· Π²ΠΈΡΠΊΠΎΠ·Ρ ΠΈ ΡΠ΅Π»ΠΊΠ°" ["price"]=> string(8) "90970.00" ["parent_id"]=> string(5) "31768" ["photo_id"]=> string(6) "116490" ["value"]=> string(7) "Rodarte" } } How to remove duplicate objects by key parent_id?
I tried array_unique, but not that. Thanks for the help.
parent_idkeyparent_idremove duplicates among each group with the sameparent_id, or even remove all duplicate objects with the sameparent_id? - teran