$block = array(1,2,3,4,5,6,7,8,9,10,11,12);
$bad_block = array(1,2,3);
foreach ($block as $key => $form) {
if ( array_search($form, $bad_block) ) {
unset($block[$key]);
}
}
print_r($block);
print_r($bad_block);
Array block
(
[0] => 1
[3] => 4
[4] => 5
[5] => 6
[6] => 7
[7] => 8
[8] => 9
[9] => 10
[10] => 11
[11] => 12
)
Array bad_block
(
[0] => 1
[1] => 2
[2] => 3
)