3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $kams = array( array('id' => '1','name' => 'Helmut Gall'), array('id' => '2','name' => 'Norbert Kreier'), array('id' => '3','name' => 'Thilo Kurtz'), array('id' => '4','name' => 'Franz Engelhardt'), array('id' => '5','name' => 'Wolfgang Christmann'), array('id' => '6','name' => 'Johann Kerschensteiner'), array('id' => '7','name' => 'Daniel Roppelt'), array('id' => '8','name' => 'Klaus Markert'), array('id' => '9','name' => 'Ludwig Nagel'), array('id' => '10','name' => 'Peter Bohnacker') ); $kams1 = array(1,2,3,4,6,9,10); $diff=array(); foreach($kams as $kam) { if(!in_array($kam["id"],$kams1)) { $diff[]=$kam; } } print_r($diff); ?>
Output for 4.3.0 - 7.1.0
Array ( [0] => Array ( [id] => 5 [name] => Wolfgang Christmann ) [1] => Array ( [id] => 7 [name] => Daniel Roppelt ) [2] => Array ( [id] => 8 [name] => Klaus Markert ) )