I've this array here with multiple object:
$batches = [
[
'id' => 2,
'number' => 'ABC'
],
[
'id' => 3,
'number' => 'ABC'
],
[
'id' => 4,
'number' => 'DEF'
]
];
Now I need to know if there are any numbers that exists more than once. In this case its ABC.
I've tried using array_sum and array_column but this seems to only work with numbers:
$test = array_sum( array_column( $batches, 'number' ) );
array_sum()? They're not numbers, you can't add them.array_count_values()