3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $communityIds = array(array('community_id' => '123', 'community_org' => 'whatevs'), array( 'community_id' => '345', 'community_org' => 'and such'), array('community_id' =>'789', 'community_org' => 'and how')); $communities = array(); $communities[345] = 1; foreach($communityIds as $communityId) { unset($communities[$communityId['community_id']]); } print_r($communityIds); print_r($communities);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Array ( [community_id] => 123 [community_org] => whatevs ) [1] => Array ( [community_id] => 345 [community_org] => and such ) [2] => Array ( [community_id] => 789 [community_org] => and how ) ) Array ( )