<?php $arr1 = [ [ "id" => '1', "order" => '123238' ], [ "id" => '2', "order" => '33278' ], [ "id" => '3', "order" => '8892372' ] ]; $arr2 = [ [ "id" => '1', "order" => '349483' ], [ "id" => '2', "order" => '9837283' ], [ "id" => '3', "order" => '33278' ] ]; $intersect = array_uintersect($arr1, $arr2, function ($a, $b) { return strcmp($a['order'], $b['order']); }); print_r($intersect); $notInArr1 = array_uintersect($arr1, $arr2, function ($a, $b) { if ($a["order"] === $b["order"]) return -1; if ($a["order"] > $b["order"]) return 1; return 0; }); print_r($notInArr1); $notInArr2 = array_uintersect($arr2, $arr1, function ($a, $b) { if ($a["order"] === $b["order"]) return -1; if ($a["order"] > $b["order"]) return 1; return 0; }); print_r($notInArr2);
You have javascript disabled. You will not be able to edit any code.