I have this array
Array (
[0] => Array ( [0] => stdClass Object ( [id] => 226 [user_id] => 1 [name] => Eden Corner Tub by Glass - $2099 ) [1] => stdClass Object ( [id] => 225 [user_id] => 1 [name] => Blue Quilted Leather Jacket by Minusey - $499 ) [2] => stdClass Object ( [id] => 222 [user_id] => 1 [name] => Darling New Bathtub by Duravit - $6300 ) ) [1] => Array ( [0] => stdClass Object ( [id] => 226 [user_id] => 1 [name] => Eden Corner Tub by Glass - $2099 ) [1] => stdClass Object ( [id] => 229 [user_id] => 1 [name] => Batman Tumbler Golf Cart - $50000 ) [2] => stdClass Object ( [id] => 228 [user_id] => 1 [name] => Swirlio Frozen Fruit Dessert Maker - $60 ) ) )
I have an array of products that I need to make sure are unique. Need to make this array unique by id. These array are generated by pushing value.
I'm trying to solve this for more than a week now, but I dont get it to work. I know it should be easy...but anyway - I don't get it :D
array_unique
work for you? php.net/manual/en/function.array-unique.php – Ronni Egeriis Aug 1 at 12:16string
representation, thus array of arrays won't be uqinue'd correctly. (string) array() is Array + notice. – baldrs Aug 1 at 12:24