I have a form in HTML. In this form, I can build catalog preferences. When I'm done with that I can click on save button and build a next one. The result is saving in an array.
When I have more than one saved catalog(sku=stock keeping unit) in my array it's possible that there are some duplicates. How can I remove the duplicates and count them (The quantity should stay even if there is a duplicate)?
Array(Array(
0:5016s18gercol, //sku(stock keeping unit)
1: 100, //quantity
2: 5017ext10002, //extra sku for extra costs(cataloge in color)
3: 1
),
Array(
0:5016s43gerbw, //sku
1: 100, //quantity
2: 5017ext10001,//extra sku for extra costs(catalog own cover)
3: 1 //quanitity extra costs
),
Array(
0: "5016s43gercol" //sku
1: "400" //quantity
2:"5017ext10001" //extra sku (own cover)
3:"1" //quantity sku
4:"5017ext10002" //extra sku (in color)
5:"1" //quantity sku
)
)
This is what i get. It should look like this:
array(5016s18gercol,
500,
5017ext10002,
2,
5017ext10001,
2)
Every sku is unique so i cant have two same sku's. I have to count them if there are more than one.