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);
Output for 7.1.25 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
<pre>Array ( [0] => Array ( [0] => Kelly [1] => female [2] => 10 ) )

preferences:
102.79 ms | 1514 KiB | 4 Q