3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = json_decode('[{ "manufacturer": "KInd", "brand": "ABC", "used": "true" }, { "manufacturer": "KInd", "brand": "ABC", "used": "true" }, { "manufacturer": "KInd", "brand": "ABC", "used": "false" }]', true); $result = []; foreach ($array as $row) { $compositeKey = implode('_', $row); if (!isset($result[$compositeKey])) { $result[$compositeKey] = $row + ['count' => 1]; } else { ++$result[$compositeKey]['count']; } } var_export(array_values($result));

preferences:
25.92 ms | 407 KiB | 5 Q