3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array ( 0 => array ( 'description' => '5390BF675E1464F32202B', 'to_email' => 'test@test.com' ), 1 => array ( 'description' => '5390BF675E1464F32202B', 'to_email' => 'test3@test.com' ), 2 => array ( 'description' => '5390BF675E1464F32202B', 'to_email' => 'testagain@gmail.com' ) ); $array2 = array ( 0 => array ( 'to_email' => 'test@test.com' ), 1 => array ( 'to_email' => 'test3@test.com' ) ); $exclude_ids = array_column($array2, 'to_email', 'to_email'); $output = array_filter($array1, function ($v) use ($exclude_ids) { return !isset($exclude_ids[$v['to_email']]); }); print_r($output);

preferences:
59.65 ms | 402 KiB | 5 Q