Hi
I have a array as below:
$array = array(
array(0,0),
array(0,1),
array(0,1),
array(0,1),
array(2,2),
array(3,4),
array(1,0),
array(1,0),
array(4,3),
array(2,3),
array(2,2),
array(3,2)
);
After I have used the code below:
foreach($kkk as $kkk)
{
$final1[] = $kkk[0].' - '.$kkk[1];
}
$result1 = array_count_values($final1);
I have got this new array $final1 below:
Array
(
[0 - 0] => 1
[0 - 1] => 3
[1 - 0] => 2
[2 - 2] => 2
[2 - 3] => 1
[3 - 2] => 1
[3 - 4] => 1
[4 - 3] => 1
)
however, I would like to have the array looks like the one below:
Array
(
[0 - 0] => 1
[0 - 1] => 5
[2 - 2] => 2
[2 - 3] => 2
[3 - 4] => 2
)
because 0 -1 and 1 - 0 are the same results, same as the 2 - 3 and 3 - 2.
thanks for your help!