3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr_1=array(array('name'=>'john','sex'=>'male','grade'=>'9'),array('name'=>'Smith','sex'=>'male','grade'=>'11')); $arr_2=array(array('name'=>'john','sex'=>'male','grade'=>'9'),array('name'=>'Smith','sex'=>'male','grade'=>'11'),array('name'=>'Kelly','sex'=>'female','grade'=>'10')); $c1 = array_map("customImplode",$arr_1); $c2 = array_map("customImplode",$arr_2); function customImplode($data){ return implode("|",$data); } function customExplode($data){ return explode("|",$data); } $result = array_map("customExplode",array_unique(array_merge(array_diff($c1,$c2),array_diff($c2,$c1)))); echo "<pre>"; print_r($result);

preferences:
33.08 ms | 411 KiB | 5 Q