Here are my arrays:
$not_wanted = array('example1', 'example2');
$from_this_array= array(
'example1'=>'value1',
'example2'=>'value2',
'should_stay'=>'value3'
)
at the end I should have
array('should_stay'=>'value3')
what I have been trying but it has a sickness
public function aaData($array){
$aaData =array();
foreach ($array as $key=>$item){
if(array_key_exists($key, $this->unset_array)){
unset($array[$key]);
$aaData[] = $item;
}
}
var_dump($aaData);
return $aaData;
}