The simplest way, for me, is to use array_filter and preg_match, set null on the array you want to remove and then filter the array, at the end reindex, otherwise you get discontinuous keys:
<?php
$a = array(
array('name' => 'MHK VL', 'PTID' => 'bab'),
array('name' => 'nbn', 'PTID' => 'bbb'),
array('name' => 'ncn', 'PTID' => 'bcb'),
array('name' => 'MHK VL', 'PTID' => 'bab'),
array('name' => 'MHKVL', 'PTID' => 'bbb'),
array('name' => 'ncn', 'PTID' => 'bcb'),
);
$c = count($a);
for($i = 0; $i < $c; $i++)
{
if(preg_match('/^MHK VL$/i',$a[$i]['name']))
{
$a[$i] = null;
}
}
$filtered = array_filter($a);
#print_r($filtered); # uncomment to check discontinuous keys
$result = array();
foreach($filtered as $key => $value)
{
$result[] = $value;
}
print_r($result); # reindexed array
?> bye :)