1
I have this array
below, and I would like to know how I can count how many equal values have in the value[0]
.
Array:
array(5) {
[0]=>
array(9) {
[0]=>
string(6) "500038"
[1]=>
string(6) "204932"
"
}
[1]=>
array(9) {
[0]=>
string(6) "500038"
[1]=>
string(6) "204932"
"
}
[2]=>
array(9) {
[0]=>
string(6) "100398"
[1]=>
string(6) "204932"
"
}
[3]=>
array(9) {
[0]=>
string(6) "100398"
[1]=>
string(6) "204932"
"
}
[4]=>
array(9) {
[0]=>
string(6) "100398"
[1]=>
string(6) "204932"
"
}
}
For example I know that it has 2 equal values that are 500038
and 3 which are 100398
. I need the total of both. The numbers on value[0]
will vary not always being the same.
I would like a way to do that because I need these figures to know the total quantity and the volume number.
That would be my idea:
Already tried using the function
array_count_values
. http://php.net/manual/en/function.array-count-values.php– Eduardo Breno
@Eduardobreno from what I understand he wants to check only the
value[0]
– Mauro Alexandre
@Mauroalexandre, right... hehe
– Eduardo Breno