3
I need to sweep the first array
and store the value and quantity of that value in another array
. I’m not succeeding because I’m having trouble storing the values in another array
.
Array:
array(5) {
[0]=>
array(1) {
[0]=>
string(2) "12"
}
[1]=>
array(1) {
[0]=>
string(2) "13"
}
[2]=>
array(1) {
[0]=>
string(3) "100"
}
[3]=>
array(1) {
[0]=>
string(3) "12"
}
[4]=>
array(1) {
[0]=>
string(3) "13"
}
}
Array with the amount and value I need:
array(3) {
[0]=>
array(1) {
[0]=>
string(2) "12"
int() "2"
}
[1]=>
array(1) {
[0]=>
string(2) "13"
int() "2"
}
[2]=>
array(1) {
[0]=>
string(3) "100"
int() "1"
}
}
Do you want to count the amount of items in the array? The
count()
does not produce results?– William Aparecido Brandino
It brings yes only I can not store in another array, I would like a new array that nor mentioned above. Not only one
count
showing the amount of items in the array.– KevinF