Hi guys,..i've two arrray data1 and data2 then i do intersect to get same value between data1 and data2, and >use count to get total same value,..how to ARSORT count result from intersect array multidimensional?
<?php
$data1 = array(
array(
'7' => 'chelsea everton',
'8' => 'everton villa',
'9' => 'villa liverpool',
'10' => 'liverpool manutd'
),
array(
'23' => 'milan inter ',
'24' => 'inter juventus',
'25' => 'juventus napoli',
),
array(
'53' => 'chelsea everton',
'54' => 'barcelona altetico',
'55' => 'altetico getafe',
'56' => 'everton villa',
)
);
$data2 = array(
array(
'3' => 'milan inter',
'4' => 'inter juventus',
'5' => 'juventus napoli',
),
array(
'117' => 'swansea everton',
'118' => 'everton villa',
'119' => 'villa liverpool',
'120' => 'liverpool manutd'
),
array(
'123' => 'milan inter ',
'124' => 'inter juventus',
'125' => 'juventus napoli',
),
array(
'137' => 'chelsea everton',
'138' => 'everton villa',
'139' => 'villa liverpool',
'140' => 'liverpool manutd'
)
);
$new_array = array();
foreach ($data1 as $in1 => $h1)
{
foreach ($data2 as $in2 => $h2)
{
$match = array_unique(array_intersect($h1, $h2));
echo count($match) . "";
}
echo "||";
}
?>
This code result like this:
0304||2030||0102||
How to arsort count result to be like this?
4300||3200||2100||