Mam dwie tablice:
1. prevPoints:
<?php ( ( [old] => 8225 [new] => 6593 ) ( [old] => 8348 [new] => 6621 ) ( [old] => 6854 [new] => 4820 ) ( [old] => 6859 [new] => 2591 ) ( [old] => 8509 [new] => 11451 ) ( [old] => 6877 [new] => 6613 ) ( [old] => 8476 [new] => 6421 ) } ?>
2. aPoints:
<?php ( ( [old] => 8348 [new] => 6621 ) ( [old] => 6859 [new] => 2591 ) ( [old] => 8509 [new] => 11451 ) ( [old] => 6877 [new] => 6613 ) ( [old] => 8476 [new] => 6421 ) ) ?>
oraz funkcje porownujaca:
<?php function compareRemove($a1, $a2) { if($a1['old'] == $a2['old']) return 0; if($a1['old'] != $a2['old']) return -1; } ?>
po wykonaniu:
<?php array_udiff($prevPoints, $aPoints, "compareRemove"); ?>
dostaje taka tablice:
<?php ( ( [old] => 8225 [new] => 6593 ) ( [old] => 8348 [new] => 6621 ) ( [old] => 6854 [new] => 4820 ) ( [old] => 6859 [new] => 2591 ) ( [old] => 8509 [new] => 11451 ) ( [old] => 6877 [new] => 6613 ) ) ?>
Co jest ewidentnie zle, bo wg. mnie funkcja powinna zwrocic tablice:
<?php ( [old] => 8225 [new] => 6593 ) ( [old] => 6854 [new] => 4820 ) ) ?>
czyli te 'podtablice', ktore sa w $prevPoints i nie ma ich w $aPoints.
Mam jakis blad??