I'm not sure this will work, but should be a little faster.
[don't call `count()' every time]
$cells_number = count($cell);
for ($i=0; $i<$cells_number; $i++)
{
$curr_cell_number = count($cell[$i]);
for ($g=0; $g<$curr_cell_number; $g++)
{
foreach($cell as $v1)
{
foreach ($v1 as $v2) {
if ($cell[$i][$g] == $v2)
$gcell[$i][$g]++;
}
}
}
}
but in any case... what you want to do is a little strange, for me.
PM